Repetier-Firmware  1.0.0
gd2_ext.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 by James Bowman <jamesb@excamera.com>
3  * Gameduino 2 library for Arduino, Raspberry Pi.
4 
5 Copyright (c) 2013, James Bowman
6 All rights reserved.
7 
8 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
11 
12 2. Redistributions in binary form must reproduce the above copyright notice, this list of
13  conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
14 
15 3. Neither the name of the Excamera Labs nor the names of its contributors may be used to endorse
16  or promote products derived from this software without specific prior written permission.
17 
18 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
19 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
21 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 
27  */
28 /*
29 This version was modified to get it working within the repetier firmware eco system.
30 Modifications in this file stay licenced under the BSD licence from the original library!
31 */
32 #ifndef _GD2_H_INCLUDED
33 #define _GD2_H_INCLUDED
34 
35 
36 #define RGB(r, g, b) ((uint32_t)((((r) & 0xffL) << 16) | (((g) & 0xffL) << 8) | ((b) & 0xffL)))
37 #define F8(x) (int((x) * 256L))
38 #define F16(x) ((int32_t)((x) * 65536L))
39 
40 #define GD_CALIBRATE (EEPROM_MODE != 0 ? 1 : 0)
41 #define GD_TRIM 2
42 #define GD_STORAGE 0 // 4
43 
45 
46 class GDClass
47 {
48 public:
49  void begin(uint8_t options = (GD_CALIBRATE | GD_TRIM | GD_STORAGE));
50 
51  uint16_t random();
52  uint16_t random(uint16_t n);
53  void seed(uint16_t n);
54  int16_t rsin(int16_t r, uint16_t th);
55  int16_t rcos(int16_t r, uint16_t th);
56  void polar(int &x, int &y, int16_t r, uint16_t th);
57  uint16_t atan2(int16_t y, int16_t x);
58 
59  void copy(const PROGMEM prog_uchar *src, int count);
60  void copyram(byte *src, int count);
61 
62  void self_calibrate(void);
63 
64  void swap(void);
65  void flush(void);
66  void finish(void);
67 
68  void play(uint8_t instrument, uint8_t note = 0);
69  void sample(uint32_t start, uint32_t len, uint16_t freq, uint16_t format, int loop = 0);
70 
71  void get_inputs(void);
72  void get_accel(int &x, int &y, int &z);
73  struct
74  {
75  uint16_t track_tag;
76  uint16_t track_val;
77  uint16_t rz;
78  uint16_t __dummy_1;
79  int16_t y;
80  int16_t x;
81  int16_t tag_y;
82  int16_t tag_x;
83  uint8_t tag;
84  uint8_t ptag;
85  } inputs;
86 
87  void AlphaFunc(byte func, byte ref);
88  void Begin(byte prim);
89  void BitmapHandle(byte handle);
90  void BitmapLayout(byte format, uint16_t linestride, uint16_t height);
91  void BitmapSize(byte filter, byte wrapx, byte wrapy, uint16_t width, uint16_t height);
92  void BitmapSource(uint32_t addr);
93  void BitmapTransformA(int32_t a);
94  void BitmapTransformB(int32_t b);
95  void BitmapTransformC(int32_t c);
96  void BitmapTransformD(int32_t d);
97  void BitmapTransformE(int32_t e);
98  void BitmapTransformF(int32_t f);
99  void BlendFunc(byte src, byte dst);
100  void Call(uint16_t dest);
101  void Cell(byte cell);
102  void ClearColorA(byte alpha);
103  void ClearColorRGB(byte red, byte green, byte blue);
104  void ClearColorRGB(uint32_t rgb);
105  void Clear(byte c, byte s, byte t);
106  void Clear(void);
107  void ClearStencil(byte s);
108  void ClearTag(byte s);
109  void ColorA(byte alpha);
110  void ColorMask(byte r, byte g, byte b, byte a);
111  void ColorRGB(byte red, byte green, byte blue);
112  void ColorRGB(uint32_t rgb);
113  void Display(void);
114  void End(void);
115  void Jump(uint16_t dest);
116  void LineWidth(uint16_t width);
117  void Macro(byte m);
118  void PointSize(uint16_t size);
119  void RestoreContext(void);
120  void Return(void);
121  void SaveContext(void);
122  void ScissorSize(uint16_t width, uint16_t height);
123  void ScissorXY(uint16_t x, uint16_t y);
124  void StencilFunc(byte func, byte ref, byte mask);
125  void StencilMask(byte mask);
126  void StencilOp(byte sfail, byte spass);
127  void TagMask(byte mask);
128  void Tag(byte s);
129  void Vertex2f(int16_t x, int16_t y);
130  void Vertex2ii(uint16_t x, uint16_t y, byte handle = 0, byte cell = 0);
131 
132  // Higher-level graphics commands
133 
134  void cmd_append(uint32_t ptr, uint32_t num);
135  void cmd_bgcolor(uint32_t c);
136  void cmd_button(int16_t x, int16_t y, uint16_t w, uint16_t h, byte font, uint16_t options, const char *s);
137  void cmd_calibrate(void);
138  void cmd_clock(int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t h, uint16_t m, uint16_t s, uint16_t ms);
139  void cmd_coldstart(void);
140  void cmd_dial(int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t val);
141  void cmd_dlstart(void);
142  void cmd_fgcolor(uint32_t c);
143  void cmd_gauge(int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t major, uint16_t minor, uint16_t val, uint16_t range);
144  void cmd_getmatrix(void);
145  void cmd_getprops(uint32_t &ptr, uint32_t &w, uint32_t &h);
146  void cmd_getptr(void);
147  void cmd_gradcolor(uint32_t c);
148  void cmd_gradient(int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1);
149  void cmd_inflate(uint32_t ptr);
150  void cmd_interrupt(uint32_t ms);
151  void cmd_keys(int16_t x, int16_t y, int16_t w, int16_t h, byte font, uint16_t options, const char*s);
152  void cmd_loadidentity(void);
153  void cmd_loadimage(uint32_t ptr, int32_t options);
154  void cmd_memcpy(uint32_t dest, uint32_t src, uint32_t num);
155  void cmd_memset(uint32_t ptr, byte value, uint32_t num);
156  uint32_t cmd_memcrc(uint32_t ptr, uint32_t num);
157  void cmd_memwrite(uint32_t ptr, uint32_t num);
158  void cmd_regwrite(uint32_t ptr, uint32_t val);
159  void cmd_number(int16_t x, int16_t y, byte font, uint16_t options, uint32_t n);
160  void cmd_progress(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range);
161  void cmd_regread(uint32_t ptr);
162  void cmd_rotate(int32_t a);
163  void cmd_scale(int32_t sx, int32_t sy);
164  void cmd_screensaver(void);
165  void cmd_scrollbar(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t size, uint16_t range);
166  void cmd_setfont(byte font, uint32_t ptr);
167  void cmd_setmatrix(void);
168  void cmd_sketch(int16_t x, int16_t y, uint16_t w, uint16_t h, uint32_t ptr, uint16_t format);
169  void cmd_slider(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t options, uint16_t val, uint16_t range);
170  void cmd_snapshot(uint32_t ptr);
171  void cmd_spinner(int16_t x, int16_t y, byte style, byte scale);
172  void cmd_stop(void);
173  void cmd_swap(void);
174  void cmd_text(int16_t x, int16_t y, byte font, uint16_t options, const char *s);
175  void cmd_textP(int16_t x, int16_t y, byte font, uint16_t options, PGM_P s);
176  void cmd_toggle(int16_t x, int16_t y, int16_t w, byte font, uint16_t options, uint16_t state, const char *s);
177  void cmd_track(int16_t x, int16_t y, uint16_t w, uint16_t h, byte tag);
178  void cmd_translate(int32_t tx, int32_t ty);
179 
180  byte rd(uint32_t addr);
181  void wr(uint32_t addr, uint8_t v);
182  uint16_t rd16(uint32_t addr);
183  void wr16(uint32_t addr, uint16_t v);
184  uint32_t rd32(uint32_t addr);
185  void wr32(uint32_t addr, uint32_t v);
186  void wr_n(uint32_t addr, byte *src, uint32_t n);
187 
188  void cmd32(uint32_t b);
189 
190  void bulkrd(uint32_t a);
191  void resume(void);
192  void __end(void);
193  void reset(void);
194 
195  void dumpscreen(void);
196  byte load(const char *filename, void (*progress)(long, long) = NULL);
197  void safeload(const char *filename);
198 
199 
200  void storage(void);
201  void tune(void);
202 
203 private:
204  static void cFFFFFF(byte v);
205  static void cI(uint32_t);
206  static void ci(int32_t);
207  static void cH(uint16_t);
208  static void ch(int16_t);
209  static void cs(const char *);
210  static void fmtcmd(const char *fmt, ...);
211 
212  static void align(byte n);
213  void cmdbyte(uint8_t b);
214 
215  uint32_t measure_freq(void);
216 
217  uint16_t lfsr, lcg;
218 };
219 
220 extern GDClass GD;
221 
222 typedef struct
223 {
224  byte handle;
225  uint16_t w, h;
226  uint16_t size;
227 } shape_t;
228 
229 // Convert degrees to Furmans
230 #define DEGREES(n) ((65536UL * (n)) / 360)
231 
232 #define NEVER 0
233 #define LESS 1
234 #define LEQUAL 2
235 #define GREATER 3
236 #define GEQUAL 4
237 #define EQUAL 5
238 #define NOTEQUAL 6
239 #define ALWAYS 7
240 
241 #define ARGB1555 0
242 #define L1 1
243 #define L4 2
244 #define L8 3
245 #define RGB332 4
246 #define ARGB2 5
247 #define ARGB4 6
248 #define RGB565 7
249 #define PALETTED 8
250 #define TEXT8X8 9
251 #define TEXTVGA 10
252 #define BARGRAPH 11
253 
254 #define NEAREST 0
255 #define BILINEAR 1
256 
257 #define BORDER 0
258 #define REPEAT 1
259 
260 #define KEEP 1
261 #define REPLACE 2
262 #define INCR 3
263 #define DECR 4
264 #define INVERT 5
265 
266 #define DLSWAP_DONE 0
267 #define DLSWAP_LINE 1
268 #define DLSWAP_FRAME 2
269 
270 #define INT_SWAP 1
271 #define INT_TOUCH 2
272 #define INT_TAG 4
273 #define INT_SOUND 8
274 #define INT_PLAYBACK 16
275 #define INT_CMDEMPTY 32
276 #define INT_CMDFLAG 64
277 #define INT_CONVCOMPLETE 128
278 
279 #define TOUCHMODE_OFF 0
280 #define TOUCHMODE_ONESHOT 1
281 #define TOUCHMODE_FRAME 2
282 #define TOUCHMODE_CONTINUOUS 3
283 
284 #define ZERO 0
285 #define ONE 1
286 #define SRC_ALPHA 2
287 #define DST_ALPHA 3
288 #define ONE_MINUS_SRC_ALPHA 4
289 #define ONE_MINUS_DST_ALPHA 5
290 
291 #define BITMAPS 1
292 #define POINTS 2
293 #define LINES 3
294 #define LINE_STRIP 4
295 #define EDGE_STRIP_R 5
296 #define EDGE_STRIP_L 6
297 #define EDGE_STRIP_A 7
298 #define EDGE_STRIP_B 8
299 #define RECTS 9
300 
301 #define OPT_MONO 1
302 #define OPT_NODL 2
303 #define OPT_FLAT 256
304 #define OPT_CENTERX 512
305 #define OPT_CENTERY 1024
306 #define OPT_CENTER (OPT_CENTERX | OPT_CENTERY)
307 #define OPT_NOBACK 4096
308 #define OPT_NOTICKS 8192
309 #define OPT_NOHM 16384
310 #define OPT_NOPOINTER 16384
311 #define OPT_NOSECS 32768
312 #define OPT_NOHANDS 49152
313 #define OPT_RIGHTX 2048
314 #define OPT_SIGNED 256
315 
316 #define LINEAR_SAMPLES 0
317 #define ULAW_SAMPLES 1
318 #define ADPCM_SAMPLES 2
319 
320 // 'instrument' argument to GD.play()
321 
322 #define SILENCE 0x00
323 
324 #define SQUAREWAVE 0x01
325 #define SINEWAVE 0x02
326 #define SAWTOOTH 0x03
327 #define TRIANGLE 0x04
328 
329 #define BEEPING 0x05
330 #define ALARM 0x06
331 #define WARBLE 0x07
332 #define CAROUSEL 0x08
333 
334 #define PIPS(n) (0x0f + (n))
335 
336 #define HARP 0x40
337 #define XYLOPHONE 0x41
338 #define TUBA 0x42
339 #define GLOCKENSPIEL 0x43
340 #define ORGAN 0x44
341 #define TRUMPET 0x45
342 #define PIANO 0x46
343 #define CHIMES 0x47
344 #define MUSICBOX 0x48
345 #define BELL 0x49
346 
347 #define CLICK 0x50
348 #define SWITCH 0x51
349 #define COWBELL 0x52
350 #define NOTCH 0x53
351 #define HIHAT 0x54
352 #define KICKDRUM 0x55
353 #define POP 0x56
354 #define CLACK 0x57
355 #define CHACK 0x58
356 
357 #define MUTE 0x60
358 #define UNMUTE 0x61
359 
360 #define RAM_CMD 1081344UL
361 #define RAM_DL 1048576UL
362 #define RAM_PAL 1056768UL
363 
364 #define REG_CLOCK 1057800UL
365 #define REG_CMD_DL 1058028UL
366 #define REG_CMD_READ 1058020UL
367 #define REG_CMD_WRITE 1058024UL
368 #define REG_CPURESET 1057820UL
369 #define REG_CSPREAD 1057892UL
370 #define REG_DITHER 1057884UL
371 #define REG_DLSWAP 1057872UL
372 #define REG_FRAMES 1057796UL
373 #define REG_FREQUENCY 1057804UL
374 #define REG_GPIO 1057936UL
375 #define REG_GPIO_DIR 1057932UL
376 #define REG_HCYCLE 1057832UL
377 #define REG_HOFFSET 1057836UL
378 #define REG_HSIZE 1057840UL
379 #define REG_HSYNC0 1057844UL
380 #define REG_HSYNC1 1057848UL
381 #define REG_ID 1057792UL
382 #define REG_INT_EN 1057948UL
383 #define REG_INT_FLAGS 1057944UL
384 #define REG_INT_MASK 1057952UL
385 #define REG_MACRO_0 1057992UL
386 #define REG_MACRO_1 1057996UL
387 #define REG_OUTBITS 1057880UL
388 #define REG_PCLK 1057900UL
389 #define REG_PCLK_POL 1057896UL
390 #define REG_PLAY 1057928UL
391 #define REG_PLAYBACK_FORMAT 1057972UL
392 #define REG_PLAYBACK_FREQ 1057968UL
393 #define REG_PLAYBACK_LENGTH 1057960UL
394 #define REG_PLAYBACK_LOOP 1057976UL
395 #define REG_PLAYBACK_PLAY 1057980UL
396 #define REG_PLAYBACK_READPTR 1057964UL
397 #define REG_PLAYBACK_START 1057956UL
398 #define REG_PWM_DUTY 1057988UL
399 #define REG_PWM_HZ 1057984UL
400 #define REG_ROTATE 1057876UL
401 #define REG_SOUND 1057924UL
402 #define REG_SWIZZLE 1057888UL
403 #define REG_TAG 1057912UL
404 #define REG_TAG_X 1057904UL
405 #define REG_TAG_Y 1057908UL
406 #define REG_TOUCH_ADC_MODE 1058036UL
407 #define REG_TOUCH_CHARGE 1058040UL
408 #define REG_TOUCH_DIRECT_XY 1058164UL
409 #define REG_TOUCH_DIRECT_Z1Z2 1058168UL
410 #define REG_TOUCH_MODE 1058032UL
411 #define REG_TOUCH_OVERSAMPLE 1058048UL
412 #define REG_TOUCH_RAW_XY 1058056UL
413 #define REG_TOUCH_RZ 1058060UL
414 #define REG_TOUCH_RZTHRESH 1058052UL
415 #define REG_TOUCH_SCREEN_XY 1058064UL
416 #define REG_TOUCH_SETTLE 1058044UL
417 #define REG_TOUCH_TAG 1058072UL
418 #define REG_TOUCH_TAG_XY 1058068UL
419 #define REG_TOUCH_TRANSFORM_A 1058076UL
420 #define REG_TOUCH_TRANSFORM_B 1058080UL
421 #define REG_TOUCH_TRANSFORM_C 1058084UL
422 #define REG_TOUCH_TRANSFORM_D 1058088UL
423 #define REG_TOUCH_TRANSFORM_E 1058092UL
424 #define REG_TOUCH_TRANSFORM_F 1058096UL
425 #define REG_TRACKER 1085440UL
426 #define REG_VCYCLE 1057852UL
427 #define REG_VOFFSET 1057856UL
428 #define REG_VOL_PB 1057916UL
429 #define REG_VOL_SOUND 1057920UL
430 #define REG_VSIZE 1057860UL
431 #define REG_VSYNC0 1057864UL
432 #define REG_VSYNC1 1057868UL
433 
434 #define VERTEX2II(x, y, handle, cell) \
435  ((2UL << 30) | (((x) & 511UL) << 21) | (((y) & 511UL) << 12) | (((handle) & 31) << 7) | (((cell) & 127) << 0))
436 
437 #define ROM_PIXEL_FF 0xc0400UL
438 
439 class Poly
440 {
441  int x0, y0, x1, y1;
442  int x[8], y[8];
443  byte n;
444  void restart()
445  {
446  n = 0;
447  x0 = 16 * 480;
448  x1 = 0;
449  y0 = 16 * 272;
450  y1 = 0;
451  }
452  void perim()
453  {
454  for (byte i = 0; i < n; i++)
455  GD.Vertex2f(x[i], y[i]);
456  GD.Vertex2f(x[0], y[0]);
457  }
458 public:
459  void begin()
460  {
461  restart();
462 
463  GD.ColorMask(0,0,0,0);
464  GD.StencilOp(KEEP, INVERT);
465  GD.StencilFunc(ALWAYS, 255, 255);
466  }
467  void v(int _x, int _y)
468  {
469  x0 = RMath::min(x0, _x >> 4);
470  x1 = RMath::max(x1, _x >> 4);
471  y0 = RMath::min(y0, _y >> 4);
472  y1 = RMath::max(y1, _y >> 4);
473  x[n] = _x;
474  y[n] = _y;
475  n++;
476  }
477  void paint()
478  {
479  x0 = RMath::max(0, x0);
480  y0 = RMath::max(0, y0);
481  x1 = RMath::min(16 * 480, x1);
482  y1 = RMath::min(16 * 272, y1);
483  GD.ScissorXY(x0, y0);
484  GD.ScissorSize(x1 - x0 + 1, y1 - y0 + 1);
485  GD.Begin(EDGE_STRIP_B);
486  perim();
487  }
488  void finish()
489  {
490  GD.ColorMask(1,1,1,1);
491  GD.StencilFunc(EQUAL, 255, 255);
492 
493  GD.Begin(EDGE_STRIP_B);
494  GD.Vertex2ii(0, 0);
495  GD.Vertex2ii(511, 0);
496  }
497  void draw()
498  {
499  paint();
500  finish();
501  }
502  void outline()
503  {
504  GD.Begin(LINE_STRIP);
505  perim();
506  }
507 };
508 
509 static byte sinus(byte x)
510 {
511  return 128 + GD.rsin(128, -16384 + (x << 7));
512 }
513 
514 
515 #define PROTO 1
516 #define STORAGE 0
517 #define CALIBRATION 1
518 #define DUMP_INPUTS 0
519 #define VERBOSE 0
520 
521 
522 
524 {
525 public:
526  void begin()
527  {
529  WRITE(UI_DISPLAY_CS, HIGH);
530 
531  HAL::spiInit(0);
532  hostcmd(0x00);
533 #if PROTO == 0
534  hostcmd(0x44); // from external crystal
535 #endif
536  hostcmd(0x68);
537  wp = 0;
538  freespace = 4096 - 4;
539  stream();
540  }
541 
542  void cmd32(uint32_t x)
543  {
544  if (freespace < 4)
545  {
546  getfree(4);
547  }
548  wp += 4;
549  freespace -= 4;
550  union
551  {
552  uint32_t c;
553  uint8_t b[4];
554  };
555  c = x;
556  HAL::spiSend(b[0]);
557  HAL::spiSend(b[1]);
558  HAL::spiSend(b[2]);
559  HAL::spiSend(b[3]);
560  }
561  void cmdbyte(byte x)
562  {
563  if (freespace == 0)
564  {
565  getfree(1);
566  }
567  wp++;
568  freespace--;
569  HAL::spiSend(x);
570  }
571  void cmd_n(byte *s, uint16_t n)
572  {
573  if (freespace < n)
574  {
575  getfree(n);
576  }
577  wp += n;
578  freespace -= n;
579  while (n > 8)
580  {
581  n -= 8;
582  HAL::spiSend(*s++);
583  HAL::spiSend(*s++);
584  HAL::spiSend(*s++);
585  HAL::spiSend(*s++);
586  HAL::spiSend(*s++);
587  HAL::spiSend(*s++);
588  HAL::spiSend(*s++);
589  HAL::spiSend(*s++);
590  }
591  while (n--)
592  HAL::spiSend(*s++);
593  }
594 
595  inline void flush()
596  {
597  getfree(0);
598  }
599  uint16_t rp()
600  {
601  uint16_t r = __rd16(REG_CMD_READ);
602  if (r == 0xfff)
603  {
604  Com::printErrorFLN(PSTR("Gameduino 2 signales defect state"));HAL::delayMilliseconds(100);
605  //REPORT(/*EXCEPTION*/r);
606  for (;;) ;
607  }
608  return r;
609  }
610  void finish()
611  {
612  wp &= 0xffc;
613  __end();
614  __wr16(REG_CMD_WRITE, wp);
615  while (rp() != wp)
616  ;
617  stream();
618  }
619 
620  byte rd(uint32_t addr)
621  {
622  __end(); // stop streaming
623  __start(addr);
624  HAL::spiSend(0); // dummy
625  byte r = HAL::spiReceive(0);
626  stream();
627  return r;
628  }
629 
630  void wr(uint32_t addr, byte v)
631  {
632  __end(); // stop streaming
633  __wstart(addr);
634  HAL::spiSend(v);
635  stream();
636  }
637 
638  uint16_t rd16(uint32_t addr)
639  {
640  uint16_t r = 0;
641  __end(); // stop streaming
642  __start(addr);
643  HAL::spiSend(0);
644  r = HAL::spiReceive(0);
645  r |= (HAL::spiReceive(0) << 8);
646  stream();
647  return r;
648  }
649 
650  void wr16(uint32_t addr, uint32_t v)
651  {
652  __end(); // stop streaming
653  __wstart(addr);
654  HAL::spiSend(v);
655  HAL::spiSend(v >> 8);
656  stream();
657  }
658 
659  uint32_t rd32(uint32_t addr)
660  {
661  __end(); // stop streaming
662  __start(addr);
663  HAL::spiSend(0);
664  union
665  {
666  uint32_t c;
667  uint8_t b[4];
668  };
669  b[0] = HAL::spiReceive(0);
670  b[1] = HAL::spiReceive(0);
671  b[2] = HAL::spiReceive(0);
672  b[3] = HAL::spiReceive(0);
673  stream();
674  return c;
675  }
676  void rd_n(byte *dst, uint32_t addr, uint16_t n)
677  {
678  __end(); // stop streaming
679  __start(addr);
680  HAL::spiSend(0);
681  while (n--)
682  *dst++ = HAL::spiReceive(0);
683  stream();
684  }
685  void wr_n(uint32_t addr, byte *src, uint16_t n)
686  {
687  __end(); // stop streaming
688  __wstart(addr);
689  while (n--)
690  HAL::spiSend(*src++);
691  stream();
692  }
693 
694  void wr32(uint32_t addr, unsigned long v)
695  {
696  __end(); // stop streaming
697  __wstart(addr);
698  HAL::spiSend(v);
699  HAL::spiSend(v >> 8);
700  HAL::spiSend(v >> 16);
701  HAL::spiSend(v >> 24);
702  stream();
703  }
704 
705  uint32_t getwp(void)
706  {
707  return RAM_CMD + (wp & 0xffc);
708  }
709 
710  void bulk(uint32_t addr)
711  {
712  __end(); // stop streaming
713  __start(addr);
714  }
715  inline void resume(void)
716  {
717  // REPORT(__rd16(REG_ID));
718  stream();
719  }
720 
721  static void __start(uint32_t addr) // start an SPI transaction to addr
722  {
723  WRITE(UI_DISPLAY_CS, LOW);
724  HAL::spiSend(addr >> 16);
725  HAL::spiSend(highByte(addr));
726  HAL::spiSend(lowByte(addr));
727  }
728 
729  static void __wstart(uint32_t addr) // start an SPI write transaction to addr
730  {
731  WRITE(UI_DISPLAY_CS, LOW);
732  HAL::spiSend(0x80 | (addr >> 16));
733  HAL::spiSend(highByte(addr));
734  HAL::spiSend(lowByte(addr));
735  }
736 
737  static inline void __end() // end the SPI transaction
738  {
739  WRITE(UI_DISPLAY_CS, HIGH);
741  }
742 
743  void stop() // end the SPI transaction
744  {
745  wp &= 0xffc;
746  __end();
747  __wr16(REG_CMD_WRITE, wp);
748  // while (__rd16(REG_CMD_READ) != wp) ;
749  }
750 
751  inline void stream(void)
752  {
753  __end();
754  __wstart(RAM_CMD + (wp & 0xfff));
755  }
756 
757  static unsigned int __rd16(uint32_t addr)
758  {
759  unsigned int r;
760 
761  __start(addr);
762  HAL::spiSend(0); // dummy
763  r = HAL::spiReceive(0);
764  r |= (((uint16_t)HAL::spiReceive(0)) << 8);
765  __end();
766  return r;
767  }
768 
769  static void __wr16(uint32_t addr, unsigned int v)
770  {
771  __wstart(addr);
772  HAL::spiSend(lowByte(v));
773  HAL::spiSend(highByte(v));
774  __end();
775  }
776 
777  static void hostcmd(byte a)
778  {
779  WRITE(UI_DISPLAY_CS, LOW);
780  HAL::spiSend(a);
781  HAL::spiSend(0x00);
782  HAL::spiSend(0x00);
783  WRITE(UI_DISPLAY_CS, HIGH);
785  }
786 
787  void getfree(uint16_t n)
788  {
789  wp &= 0xfff;
790  __end();
791  __wr16(REG_CMD_WRITE, wp & 0xffc);
792  do
793  {
794  uint16_t fullness = (wp - rp()) & 4095;
795  freespace = (4096 - 4) - fullness;
796  }
797  while (freespace < n);
798  stream();
799  }
800 
801  byte streaming;
802  uint16_t wp;
803  uint16_t freespace;
804 };
805 
807 
809 void GDClass::flush(void)
810 {
811  GDTR.flush();
812 }
813 
814 void GDClass::swap(void)
815 {
816  Display();
817  cmd_swap();
819  cmd_dlstart();
820  GDTR.flush();
821 }
822 
823 uint32_t GDClass::measure_freq(void)
824 {
825  unsigned long t0 = GDTR.rd32(REG_CLOCK);
826  HAL::delayMicroseconds(15625);
827  unsigned long t1 = GDTR.rd32(REG_CLOCK);
828  return (t1 - t0) << 6;
829 }
830 
831 #define REG_TRIM 0x10256C
832 #define LOW_FREQ_BOUND 47040000UL
833 
834 void GDClass::tune(void)
835 {
836  uint32_t f;
837  for (byte i = 0; (i < 31) && ((f = measure_freq()) < LOW_FREQ_BOUND); i++)
838  GDTR.wr(REG_TRIM, i);
839  GDTR.wr32(REG_FREQUENCY, f);
840 }
841 
842 void GDClass::begin(uint8_t options)
843 {
844  GDTR.begin();
845 
846 #if VERBOSE
847  Serial.println("ID REGISTER:");
848  Serial.println(GDTR.rd(REG_ID), HEX);
849 #endif
850 
851  // Generate a blank screen
852  cmd_dlstart();
853  Clear();
854  swap();
855  finish();
856 
857  GDTR.wr(REG_PCLK_POL, 1);
858  GDTR.wr(REG_PCLK, 5);
859 #if PROTO == 1
860  GDTR.wr(REG_ROTATE, 1);
861  GDTR.wr(REG_SWIZZLE, 3);
862 #endif
863  GDTR.wr(REG_GPIO_DIR, 0x83);
864  GDTR.wr(REG_GPIO, 0x80);
865 
866  if (options & GD_CALIBRATE)
867  {
868 #if CALIBRATION
869  if (HAL::eprGetByte(EPR_TOUCHSCREEN) != 0x7c)
870  {
871  self_calibrate();
872  // for (int i = 0; i < 24; i++) Serial.println(GDTR.rd(REG_TOUCH_TRANSFORM_A + i), HEX);
873  for (int i = 0; i < 24; i++)
875  HAL::eprSetByte(EPR_TOUCHSCREEN, 0x7c); // is written!
876  uint8_t newcheck = EEPROM::computeChecksum();
877  if(newcheck != HAL::eprGetByte(EPR_INTEGRITY_BYTE))
879 
880  }
881  else
882  {
883  for (int i = 0; i < 24; i++)
885  }
886 #endif
887 
888 
889 #if CALIBRATION && defined(RASPBERRY_PI)
890  {
891  uint8_t cal[24];
892  FILE *calfile = fopen(".calibration", "r");
893  if (calfile == NULL)
894  {
895  calfile = fopen(".calibration", "w");
896  if (calfile != NULL)
897  {
898  self_calibrate();
899  for (int i = 0; i < 24; i++)
900  cal[i] = GDTR.rd(REG_TOUCH_TRANSFORM_A + i);
901  fwrite(cal, 1, sizeof(cal), calfile);
902  fclose(calfile);
903  }
904  }
905  else
906  {
907  fread(cal, 1, sizeof(cal), calfile);
908  for (int i = 0; i < 24; i++)
909  GDTR.wr(REG_TOUCH_TRANSFORM_A + i, cal[i]);
910  fclose(calfile);
911  }
912  }
913 #endif
914  }
915 
916  GDTR.wr16(REG_TOUCH_RZTHRESH, 1200);
917 
918  lfsr = 0x5555;
919  lcg = 0;
920 
921 #if STORAGE && defined(ARDUINO)
922  if (options & GD_STORAGE)
923  {
924  storage();
925  }
926 #endif
927 
928  if (options & GD_TRIM)
929  {
930  tune();
931  }
932 }
933 
935 {
936  cmd_dlstart();
937  Clear();
938  cmd_text(240, 100, 30, OPT_CENTERX, "please tap on the dot");
939  cmd_calibrate();
940  finish();
942  cmd_dlstart();
943  GDTR.flush();
944 }
945 
946 void GDClass::seed(uint16_t n)
947 {
948  lfsr = n | 1;
949  lcg = n ^ 0x7921;
950 }
951 uint16_t GDClass::random()
952 {
953  lfsr = (lfsr >> 1) ^ (-(lfsr & 1u) & 0xB400u);
954  lcg = (lcg * 47) + 60497;
955  return (lcg ^ lfsr);
956 }
957 uint16_t GDClass::random(uint16_t n)
958 {
959  return GDClass::random() % n;
960 }
961 
962 
963 // >>> [int(65535*math.sin(math.pi * 2 * i / 1024)) for i in range(257)]
964 static const PROGMEM prog_int16_t sintab[257] =
965 {
966  0, 402, 804, 1206, 1608, 2010, 2412, 2813, 3215, 3617, 4018, 4419, 4821, 5221, 5622, 6023, 6423, 6823, 7223, 7622, 8022, 8421, 8819, 9218, 9615, 10013, 10410, 10807, 11203, 11599, 11995, 12390, 12785, 13179, 13573, 13966, 14358, 14750, 15142, 15533, 15923, 16313, 16702, 17091, 17479, 17866, 18252, 18638, 19023, 19408, 19791, 20174, 20557, 20938, 21319, 21699, 22078, 22456, 22833, 23210, 23585, 23960, 24334, 24707, 25079, 25450, 25820, 26189, 26557, 26924, 27290, 27655, 28019, 28382, 28744, 29105, 29465, 29823, 30181, 30537, 30892, 31247, 31599, 31951, 32302, 32651, 32999, 33346, 33691, 34035, 34378, 34720, 35061, 35400, 35737, 36074, 36409, 36742, 37075, 37406, 37735, 38063, 38390, 38715, 39039, 39361, 39682, 40001, 40319, 40635, 40950, 41263, 41574, 41885, 42193, 42500, 42805, 43109, 43411, 43711, 44010, 44307, 44603, 44896, 45189, 45479, 45768, 46055, 46340, 46623, 46905, 47185, 47463, 47739, 48014, 48287, 48558, 48827, 49094, 49360, 49623, 49885, 50145, 50403, 50659, 50913, 51165, 51415, 51664, 51910, 52155, 52397, 52638, 52876, 53113, 53347, 53580, 53810, 54039, 54265, 54490, 54712, 54933, 55151, 55367, 55581, 55793, 56003, 56211, 56416, 56620, 56821, 57021, 57218, 57413, 57606, 57796, 57985, 58171, 58355, 58537, 58717, 58894, 59069, 59242, 59413, 59582, 59748, 59912, 60074, 60234, 60391, 60546, 60699, 60849, 60997, 61143, 61287, 61428, 61567, 61704, 61838, 61970, 62100, 62227, 62352, 62474, 62595, 62713, 62828, 62941, 63052, 63161, 63267, 63370, 63472, 63570, 63667, 63761, 63853, 63942, 64029, 64114, 64196, 64275, 64353, 64427, 64500, 64570, 64637, 64702, 64765, 64825, 64883, 64938, 64991, 65042, 65090, 65135, 65178, 65219, 65257, 65293, 65326, 65357, 65385, 65411, 65435, 65456, 65474, 65490, 65504, 65515, 65523, 65530, 65533, 65535
967 };
968 
969 int16_t GDClass::rsin(int16_t r, uint16_t th)
970 {
971  th >>= 6; // angle 0-123
972  // return int(r * sin((2 * M_PI) * th / 1024.));
973  int th4 = th & 511;
974  if (th4 & 256)
975  th4 = 512 - th4; // 256->256 257->255, etc
976  uint16_t s = pgm_read_word_near(sintab + th4);
977  int16_t p = ((uint32_t)s * r) >> 16;
978  if (th & 512)
979  p = -p;
980  return p;
981 }
982 
983 int16_t GDClass::rcos(int16_t r, uint16_t th)
984 {
985  return rsin(r, th + 0x4000);
986 }
987 
988 void GDClass::polar(int &x, int &y, int16_t r, uint16_t th)
989 {
990  x = (int)(-GD.rsin(r, th));
991  y = (int)( GD.rcos(r, th));
992 }
993 
994 // >>> [int(round(1024 * math.atan(i / 256.) / math.pi)) for i in range(256)]
995 static const PROGMEM prog_uchar atan8[] =
996 {
997  0,1,3,4,5,6,8,9,10,11,13,14,15,17,18,19,20,22,23,24,25,27,28,29,30,32,33,34,36,37,38,39,41,42,43,44,46,47,48,49,51,52,53,54,55,57,58,59,60,62,63,64,65,67,68,69,70,71,73,74,75,76,77,79,80,81,82,83,85,86,87,88,89,91,92,93,94,95,96,98,99,100,101,102,103,104,106,107,108,109,110,111,112,114,115,116,117,118,119,120,121,122,124,125,126,127,128,129,130,131,132,133,134,135,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,177,178,179,180,181,182,183,184,185,186,187,188,188,189,190,191,192,193,194,195,195,196,197,198,199,200,201,201,202,203,204,205,206,206,207,208,209,210,211,211,212,213,214,215,215,216,217,218,219,219,220,221,222,222,223,224,225,225,226,227,228,228,229,230,231,231,232,233,234,234,235,236,236,237,238,239,239,240,241,241,242,243,243,244,245,245,246,247,248,248,249,250,250,251,251,252,253,253,254,255,255
998 };
999 
1000 uint16_t GDClass::atan2(int16_t y, int16_t x)
1001 {
1002  uint16_t a;
1003  uint16_t xx = 0;
1004 
1005  if ((x <= 0) ^ (y > 0))
1006  {
1007  int16_t t;
1008  t = x;
1009  x = y;
1010  y = t;
1011  xx ^= 0x4000;
1012  }
1013  if (x <= 0)
1014  {
1015  x = -x;
1016  }
1017  else
1018  {
1019  xx ^= 0x8000;
1020  }
1021  y = abs(y);
1022  if (x > y)
1023  {
1024  int16_t t;
1025  t = x;
1026  x = y;
1027  y = t;
1028  xx ^= 0x3fff;
1029  }
1030  while ((x | y) & 0xff80)
1031  {
1032  x >>= 1;
1033  y >>= 1;
1034  }
1035  if (y == 0)
1036  {
1037  a = 0;
1038  }
1039  else if (x == y)
1040  {
1041  a = 0x2000;
1042  }
1043  else
1044  {
1045  // assert(x <= y);
1046  int r = ((x << 8) / y);
1047  // assert(0 <= r);
1048  // assert(r < 256);
1049  a = pgm_read_byte(atan8 + r) << 5;
1050  }
1051  a ^= xx;
1052  return a;
1053 }
1054 
1055 void GDClass::align(byte n)
1056 {
1057  while ((n++) & 3)
1058  GDTR.cmdbyte(0);
1059 }
1060 
1061 void GDClass::cH(uint16_t v)
1062 {
1063  GDTR.cmdbyte(v & 0xff);
1064  GDTR.cmdbyte((v >> 8) & 0xff);
1065 }
1066 
1067 void GDClass::ch(int16_t v)
1068 {
1069  cH((uint16_t)v);
1070 }
1071 
1072 void GDClass::cI(uint32_t v)
1073 {
1074  GDTR.cmd32(v);
1075 }
1076 
1077 void GDClass::cFFFFFF(byte v)
1078 {
1079  union
1080  {
1081  uint32_t c;
1082  uint8_t b[4];
1083  };
1084  b[0] = v;
1085  b[1] = 0xff;
1086  b[2] = 0xff;
1087  b[3] = 0xff;
1088  GDTR.cmd32(c);
1089 }
1090 
1091 void GDClass::ci(int32_t v)
1092 {
1093  cI((uint32_t) v);
1094 }
1095 
1096 void GDClass::cs(const char *s)
1097 {
1098  while (*s)
1099  {
1100  char c = *s++;
1101  GDTR.cmdbyte(c);
1102  }
1103  GDTR.cmdbyte(0);
1104 }
1105 
1106 void GDClass::copy(const PROGMEM prog_uchar *src, int count)
1107 {
1108  byte a = count & 3;
1109  while (count--)
1110  {
1111  GDTR.cmdbyte(pgm_read_byte_near(src));
1112  src++;
1113  }
1114  align(a);
1115 }
1116 
1117 void GDClass::copyram(byte *src, int count)
1118 {
1119  byte a = count & 3;
1120  GDTR.cmd_n(src, count);
1121  align(a);
1122 }
1123 
1124 void GDClass::AlphaFunc(byte func, byte ref)
1125 {
1126  cI((9UL << 24) | ((func & 7L) << 8) | ((ref & 255L) << 0));
1127 }
1128 void GDClass::Begin(byte prim)
1129 {
1130  cI((31UL << 24) | prim);
1131 }
1132 void GDClass::BitmapHandle(byte handle)
1133 {
1134  cI((5UL << 24) | handle);
1135 }
1136 void GDClass::BitmapLayout(byte format, uint16_t linestride, uint16_t height)
1137 {
1138  // cI((7UL << 24) | ((format & 31L) << 19) | ((linestride & 1023L) << 9) | ((height & 511L) << 0));
1139  union
1140  {
1141  uint32_t c;
1142  uint8_t b[4];
1143  };
1144  b[0] = height;
1145  b[1] = (1 & (height >> 8)) | (linestride << 1);
1146  b[2] = (7 & (linestride >> 7)) | (format << 3);
1147  b[3] = 7;
1148  cI(c);
1149 }
1150 void GDClass::BitmapSize(byte filter, byte wrapx, byte wrapy, uint16_t width, uint16_t height)
1151 {
1152  byte fxy = (filter << 2) | (wrapx << 1) | (wrapy);
1153  // cI((8UL << 24) | ((uint32_t)fxy << 18) | ((width & 511L) << 9) | ((height & 511L) << 0));
1154  union
1155  {
1156  uint32_t c;
1157  uint8_t b[4];
1158  };
1159  b[0] = height;
1160  b[1] = (1 & (height >> 8)) | (width << 1);
1161  b[2] = (3 & (width >> 7)) | (fxy << 2);
1162  b[3] = 8;
1163  cI(c);
1164 }
1165 void GDClass::BitmapSource(uint32_t addr)
1166 {
1167  cI((1UL << 24) | ((addr & 1048575L) << 0));
1168 }
1170 {
1171  cI((21UL << 24) | ((a & 131071L) << 0));
1172 }
1174 {
1175  cI((22UL << 24) | ((b & 131071L) << 0));
1176 }
1178 {
1179  cI((23UL << 24) | ((c & 16777215L) << 0));
1180 }
1182 {
1183  cI((24UL << 24) | ((d & 131071L) << 0));
1184 }
1186 {
1187  cI((25UL << 24) | ((e & 131071L) << 0));
1188 }
1190 {
1191  cI((26UL << 24) | ((f & 16777215L) << 0));
1192 }
1193 void GDClass::BlendFunc(byte src, byte dst)
1194 {
1195  cI((11UL << 24) | ((src & 7L) << 3) | ((dst & 7L) << 0));
1196 }
1197 void GDClass::Call(uint16_t dest)
1198 {
1199  cI((29UL << 24) | ((dest & 2047L) << 0));
1200 }
1201 void GDClass::Cell(byte cell)
1202 {
1203  cI((6UL << 24) | ((cell & 127L) << 0));
1204 }
1205 void GDClass::ClearColorA(byte alpha)
1206 {
1207  cI((15UL << 24) | ((alpha & 255L) << 0));
1208 }
1209 void GDClass::ClearColorRGB(byte red, byte green, byte blue)
1210 {
1211  cI((2UL << 24) | ((red & 255L) << 16) | ((green & 255L) << 8) | ((blue & 255L) << 0));
1212 }
1213 void GDClass::ClearColorRGB(uint32_t rgb)
1214 {
1215  cI((2UL << 24) | (rgb & 0xffffffL));
1216 }
1217 void GDClass::Clear(byte c, byte s, byte t)
1218 {
1219  byte m = (c << 2) | (s << 1) | t;
1220  cI((38UL << 24) | m);
1221 }
1222 void GDClass::Clear(void)
1223 {
1224  cI((38UL << 24) | 7);
1225 }
1227 {
1228  cI((17UL << 24) | ((s & 255L) << 0));
1229 }
1230 void GDClass::ClearTag(byte s)
1231 {
1232  cI((18UL << 24) | ((s & 255L) << 0));
1233 }
1234 void GDClass::ColorA(byte alpha)
1235 {
1236  cI((16UL << 24) | ((alpha & 255L) << 0));
1237 }
1238 void GDClass::ColorMask(byte r, byte g, byte b, byte a)
1239 {
1240  cI((32UL << 24) | ((r & 1L) << 3) | ((g & 1L) << 2) | ((b & 1L) << 1) | ((a & 1L) << 0));
1241 }
1242 void GDClass::ColorRGB(byte red, byte green, byte blue)
1243 {
1244  // cI((4UL << 24) | ((red & 255L) << 16) | ((green & 255L) << 8) | ((blue & 255L) << 0));
1245  union
1246  {
1247  uint32_t c;
1248  uint8_t b[4];
1249  };
1250  b[0] = blue;
1251  b[1] = green;
1252  b[2] = red;
1253  b[3] = 4;
1254  cI(c);
1255 }
1256 void GDClass::ColorRGB(uint32_t rgb)
1257 {
1258  cI((4UL << 24) | (rgb & 0xffffffL));
1259 }
1261 {
1262  cI((0UL << 24));
1263 }
1264 void GDClass::End(void)
1265 {
1266  cI((33UL << 24));
1267 }
1268 void GDClass::Jump(uint16_t dest)
1269 {
1270  cI((30UL << 24) | ((dest & 2047L) << 0));
1271 }
1272 void GDClass::LineWidth(uint16_t width)
1273 {
1274  cI((14UL << 24) | ((width & 4095L) << 0));
1275 }
1276 void GDClass::Macro(byte m)
1277 {
1278  cI((37UL << 24) | ((m & 1L) << 0));
1279 }
1280 void GDClass::PointSize(uint16_t size)
1281 {
1282  cI((13UL << 24) | ((size & 8191L) << 0));
1283 }
1285 {
1286  cI((35UL << 24));
1287 }
1289 {
1290  cI((36UL << 24));
1291 }
1293 {
1294  cI((34UL << 24));
1295 }
1296 void GDClass::ScissorSize(uint16_t width, uint16_t height)
1297 {
1298  cI((28UL << 24) | ((width & 1023L) << 10) | ((height & 1023L) << 0));
1299 }
1300 void GDClass::ScissorXY(uint16_t x, uint16_t y)
1301 {
1302  cI((27UL << 24) | ((x & 511L) << 9) | ((y & 511L) << 0));
1303 }
1304 void GDClass::StencilFunc(byte func, byte ref, byte mask)
1305 {
1306  cI((10UL << 24) | ((func & 7L) << 16) | ((ref & 255L) << 8) | ((mask & 255L) << 0));
1307 }
1308 void GDClass::StencilMask(byte mask)
1309 {
1310  cI((19UL << 24) | ((mask & 255L) << 0));
1311 }
1312 void GDClass::StencilOp(byte sfail, byte spass)
1313 {
1314  cI((12UL << 24) | ((sfail & 7L) << 3) | ((spass & 7L) << 0));
1315 }
1316 void GDClass::TagMask(byte mask)
1317 {
1318  cI((20UL << 24) | ((mask & 1L) << 0));
1319 }
1320 void GDClass::Tag(byte s)
1321 {
1322  cI((3UL << 24) | ((s & 255L) << 0));
1323 }
1324 void GDClass::Vertex2f(int16_t x, int16_t y)
1325 {
1326  // x = int(16 * x);
1327  // y = int(16 * y);
1328  cI((1UL << 30) | ((x & 32767L) << 15) | ((y & 32767L) << 0));
1329 }
1330 void GDClass::Vertex2ii(uint16_t x, uint16_t y, byte handle, byte cell)
1331 {
1332  // cI((2UL << 30) | ((x & 511L) << 21) | ((y & 511L) << 12) | ((handle & 31L) << 7) | ((cell & 127L) << 0));
1333  union
1334  {
1335  uint32_t c;
1336  uint8_t b[4];
1337  };
1338  b[0] = cell | ((handle & 1) << 7);
1339  b[1] = (handle >> 1) | (y << 4);
1340  b[2] = (y >> 4) | (x << 5);
1341  b[3] = (2 << 6) | (x >> 3);
1342  cI(c);
1343 }
1344 
1345 void GDClass::fmtcmd(const char *fmt, ...)
1346 {
1347  va_list ap;
1348  va_start(ap, fmt);
1349  byte sz = 0; // Only the low 2 bits matter
1350  const char *s;
1351 
1352  while (*fmt)
1353  switch (*fmt++)
1354  {
1355  case 'i':
1356  case 'I':
1357  cI(va_arg(ap, uint32_t));
1358  break;
1359  case 'h':
1360  case 'H':
1361  cH(va_arg(ap, unsigned int));
1362  sz += 2;
1363  break;
1364  case 's':
1365  s = va_arg(ap, const char*);
1366  cs(s);
1367  sz += strlen(s) + 1;
1368  break;
1369  }
1370  align(sz);
1371 }
1372 
1373 void GDClass::cmd_append(uint32_t ptr, uint32_t num)
1374 {
1375  cFFFFFF(0x1e);
1376  cI(ptr);
1377  cI(num);
1378 }
1379 void GDClass::cmd_bgcolor(uint32_t c)
1380 {
1381  fmtcmd("II", 0xffffff09UL, c);
1382 }
1383 void GDClass::cmd_button(int16_t x, int16_t y, uint16_t w, uint16_t h, byte font, uint16_t options, const char *s)
1384 {
1385  fmtcmd("IhhhhhHs", 0xffffff0dUL, x, y, w, h, font, options, s);
1386 }
1388 {
1389  cFFFFFF(0x15);
1390  cFFFFFF(0xff);
1391 }
1392 void GDClass::cmd_clock(int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t h, uint16_t m, uint16_t s, uint16_t ms)
1393 {
1394  fmtcmd("IhhhHHHHH", 0xffffff14UL, x, y, r, options, h, m, s, ms);
1395 }
1397 {
1398  cFFFFFF(0x32);
1399 }
1400 void GDClass::cmd_dial(int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t val)
1401 {
1402  fmtcmd("IhhhHH", 0xffffff2dUL, x, y, r, options, val);
1403 }
1405 {
1406  cFFFFFF(0x00);
1407 }
1408 void GDClass::cmd_fgcolor(uint32_t c)
1409 {
1410  fmtcmd("II", 0xffffff0aUL, c);
1411 }
1412 void GDClass::cmd_gauge(int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t major, uint16_t minor, uint16_t val, uint16_t range)
1413 {
1414  fmtcmd("IhhhHHHHH", 0xffffff13UL, x, y, r, options, major, minor, val, range);
1415 }
1417 {
1418  fmtcmd("Iiiiiii", 0xffffff33UL, 0, 0, 0, 0, 0, 0);
1419 }
1420 void GDClass::cmd_getprops(uint32_t &ptr, uint32_t &w, uint32_t &h)
1421 {
1422  cFFFFFF(0x25);
1423  ptr = GDTR.getwp();
1424  cI(0);
1425  w = GDTR.getwp();
1426  cI(0);
1427  h = GDTR.getwp();
1428  cI(0);
1429 }
1431 {
1432  fmtcmd("II", 0xffffff23UL, 0);
1433 }
1434 void GDClass::cmd_gradcolor(uint32_t c)
1435 {
1436  fmtcmd("II", 0xffffff34UL, c);
1437 }
1438 void GDClass::cmd_gradient(int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1)
1439 {
1440  fmtcmd("IhhIhhI", 0xffffff0bUL, x0, y0, rgb0, x1, y1, rgb1);
1441 }
1442 void GDClass::cmd_inflate(uint32_t ptr)
1443 {
1444  cFFFFFF(0x22);
1445  cI(ptr);
1446 }
1447 void GDClass::cmd_interrupt(uint32_t ms)
1448 {
1449  fmtcmd("II", 0xffffff02UL, ms);
1450 }
1451 void GDClass::cmd_keys(int16_t x, int16_t y, int16_t w, int16_t h, byte font, uint16_t options, const char*s)
1452 {
1453  fmtcmd("IhhhhhHs", 0xffffff0eUL, x, y, w, h, font, options, s);
1454 }
1456 {
1457  cFFFFFF(0x26);
1458 }
1459 void GDClass::cmd_loadimage(uint32_t ptr, int32_t options)
1460 {
1461  fmtcmd("III", 0xffffff24UL, ptr, options);
1462 }
1463 void GDClass::cmd_memcpy(uint32_t dest, uint32_t src, uint32_t num)
1464 {
1465  fmtcmd("IIII", 0xffffff1dUL, dest, src, num);
1466 }
1467 void GDClass::cmd_memset(uint32_t ptr, byte value, uint32_t num)
1468 {
1469  cFFFFFF(0x1b);
1470  cI(ptr);
1471  cI((uint32_t)value);
1472  cI(num);
1473 }
1474 uint32_t GDClass::cmd_memcrc(uint32_t ptr, uint32_t num)
1475 {
1476  cFFFFFF(0x18);
1477  cI(ptr);
1478  cI(num);
1479  uint32_t r = GDTR.getwp();
1480  cI(0xFFFFFFFF);
1481  return r;
1482 }
1483 void GDClass::cmd_memwrite(uint32_t ptr, uint32_t num)
1484 {
1485  fmtcmd("III", 0xffffff1aUL, ptr, num);
1486 }
1487 void GDClass::cmd_regwrite(uint32_t ptr, uint32_t val)
1488 {
1489  cFFFFFF(0x1a);
1490  cI(ptr);
1491  cI(4UL);
1492  cI(val);
1493 }
1494 void GDClass::cmd_number(int16_t x, int16_t y, byte font, uint16_t options, uint32_t n)
1495 {
1496  // fmtcmd("IhhhHi", 0xffffff2eUL, x, y, font, options, n);
1497  cFFFFFF(0x2e);
1498  ch(x);
1499  ch(y);
1500  ch(font);
1501  cH(options);
1502  ci(n);
1503 }
1504 void GDClass::cmd_progress(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range)
1505 {
1506  fmtcmd("IhhhhHHH", 0xffffff0fUL, x, y, w, h, options, val, range);
1507 }
1508 void GDClass::cmd_regread(uint32_t ptr)
1509 {
1510  fmtcmd("III", 0xffffff19UL, ptr, 0);
1511 }
1512 void GDClass::cmd_rotate(int32_t a)
1513 {
1514  cFFFFFF(0x29);
1515  ci(a);
1516 }
1517 void GDClass::cmd_scale(int32_t sx, int32_t sy)
1518 {
1519  cFFFFFF(0x28);
1520  ci(sx);
1521  ci(sy);
1522 }
1524 {
1525  cFFFFFF(0x2f);
1526 }
1527 void GDClass::cmd_scrollbar(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t size, uint16_t range)
1528 {
1529  fmtcmd("IhhhhHHHH", 0xffffff11UL, x, y, w, h, options, val, size, range);
1530 }
1531 void GDClass::cmd_setfont(byte font, uint32_t ptr)
1532 {
1533  fmtcmd("III", 0xffffff2bUL, font, ptr);
1534 }
1536 {
1537  cFFFFFF(0x2a);
1538 }
1539 void GDClass::cmd_sketch(int16_t x, int16_t y, uint16_t w, uint16_t h, uint32_t ptr, uint16_t format)
1540 {
1541  cFFFFFF(0x30);
1542  ch(x);
1543  ch(y);
1544  cH(w);
1545  cH(h);
1546  cI(ptr);
1547  cI(format);
1548 }
1549 void GDClass::cmd_slider(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t options, uint16_t val, uint16_t range)
1550 {
1551  fmtcmd("IhhhhHHH", 0xffffff10UL, x, y, w, h, options, val, range);
1552 }
1553 void GDClass::cmd_snapshot(uint32_t ptr)
1554 {
1555  fmtcmd("II", 0xffffff1fUL, ptr);
1556 }
1557 void GDClass::cmd_spinner(int16_t x, int16_t y, byte style, byte scale)
1558 {
1559  cFFFFFF(0x16);
1560  ch(x);
1561  ch(y);
1562  cH(style);
1563  cH(scale);
1564 }
1566 {
1567  cFFFFFF(0x17);
1568 }
1570 {
1571  cFFFFFF(0x01);
1572 }
1573 void GDClass::cmd_text(int16_t x, int16_t y, byte font, uint16_t options, const char *s)
1574 {
1575  // fmtcmd("IhhhHs", 0xffffff0cUL, x, y, font, options, s);
1576  cFFFFFF(0x0c);
1577  ch(x);
1578  ch(y);
1579  ch(font);
1580  cH(options);
1581  cs(s);
1582  align(strlen(s) + 1);
1583 }
1584 void GDClass::cmd_textP(int16_t x, int16_t y, byte font, uint16_t options, PGM_P sp) {
1585  char s[60];
1586  char cr;
1587  uint8_t len = 0;
1588  do {
1589  cr = HAL::readFlashByte(sp++);
1590  s[len++] = cr;
1591  } while(cr);
1592  len--;
1593  // fmtcmd("IhhhHs", 0xffffff0cUL, x, y, font, options, s);
1594  cFFFFFF(0x0c);
1595  ch(x);
1596  ch(y);
1597  ch(font);
1598  cH(options);
1599  cs(s);
1600  align(strlen(s) + 1);
1601 }
1602 void GDClass::cmd_toggle(int16_t x, int16_t y, int16_t w, byte font, uint16_t options, uint16_t state, const char *s)
1603 {
1604  fmtcmd("IhhhhHHs", 0xffffff12UL, x, y, w, font, options, state, s);
1605 }
1606 void GDClass::cmd_track(int16_t x, int16_t y, uint16_t w, uint16_t h, byte tag)
1607 {
1608  fmtcmd("Ihhhhh", 0xffffff2cUL, x, y, w, h, tag);
1609 }
1610 void GDClass::cmd_translate(int32_t tx, int32_t ty)
1611 {
1612  cFFFFFF(0x27);
1613  ci(tx);
1614  ci(ty);
1615 }
1616 
1617 byte GDClass::rd(uint32_t addr)
1618 {
1619  return GDTR.rd(addr);
1620 }
1621 void GDClass::wr(uint32_t addr, uint8_t v)
1622 {
1623  GDTR.wr(addr, v);
1624 }
1625 uint16_t GDClass::rd16(uint32_t addr)
1626 {
1627  return GDTR.rd16(addr);
1628 }
1629 void GDClass::wr16(uint32_t addr, uint16_t v)
1630 {
1631  GDTR.wr16(addr, v);
1632 }
1633 uint32_t GDClass::rd32(uint32_t addr)
1634 {
1635  return GDTR.rd32(addr);
1636 }
1637 void GDClass::wr32(uint32_t addr, uint32_t v)
1638 {
1639  GDTR.wr32(addr, v);
1640 }
1641 void GDClass::wr_n(uint32_t addr, byte *src, uint32_t n)
1642 {
1643  GDTR.wr_n(addr, src, n);
1644 }
1645 
1646 void GDClass::cmdbyte(uint8_t b)
1647 {
1648  GDTR.cmdbyte(b);
1649 }
1650 void GDClass::cmd32(uint32_t b)
1651 {
1652  GDTR.cmd32(b);
1653 }
1655 {
1656  GDTR.finish();
1657 }
1658 void GDClass::get_accel(int &x, int &y, int &z)
1659 {
1660  static int f[3];
1661 
1662  for (byte i = 0; i < 3; i++)
1663  {
1664  int a = analogRead(A0 + i);
1665  // Serial.print(a, DEC); Serial.print(" ");
1666  int s = (-160 * (a - 376)) >> 6;
1667  f[i] = ((3 * f[i]) >> 2) + (s >> 2);
1668  }
1669  // Serial.println();
1670  x = f[2];
1671  y = f[1];
1672  z = f[0];
1673 }
1675 {
1676  GDTR.finish();
1677  byte *bi = (byte*)&inputs;
1678  GDTR.rd_n(bi, REG_TRACKER, 4);
1679  GDTR.rd_n(bi + 4, REG_TOUCH_RZ, 13);
1680  GDTR.rd_n(bi + 17, REG_TAG, 1);
1681 #if DUMP_INPUTS
1682  for (size_t i = 0; i < sizeof(inputs); i++)
1683  {
1684  Serial.print(bi[i], HEX);
1685  Serial.print(" ");
1686  }
1687  Serial.println();
1688 #endif
1689 }
1690 void GDClass::bulkrd(uint32_t a)
1691 {
1692  GDTR.bulk(a);
1693 }
1695 {
1696  GDTR.resume();
1697 }
1698 void GDClass::__end(void)
1699 {
1700  GDTR.__end();
1701 }
1702 void GDClass::play(uint8_t instrument, uint8_t note)
1703 {
1704  wr16(REG_SOUND, (note << 8) | instrument);
1705  wr(REG_PLAY, 1);
1706 }
1707 void GDClass::sample(uint32_t start, uint32_t len, uint16_t freq, uint16_t format, int loop)
1708 {
1709  GD.wr32(REG_PLAYBACK_START, start);
1710  GD.wr32(REG_PLAYBACK_LENGTH, len);
1711  GD.wr16(REG_PLAYBACK_FREQ, freq);
1712  GD.wr(REG_PLAYBACK_FORMAT, format);
1713  GD.wr(REG_PLAYBACK_LOOP, loop);
1714  GD.wr(REG_PLAYBACK_PLAY, 1);
1715 }
1717 {
1718  GDTR.__end();
1719  GDTR.wr(REG_CPURESET, 1);
1720  GDTR.wr(REG_CPURESET, 0);
1721  GDTR.resume();
1722 }
1723 
1724 // Generated by mk_bsod.py. Blue screen with 'ERROR' text
1725 static const PROGMEM prog_uchar __bsod[31] =
1726 {
1727  0, 255, 255, 255, 255, 0, 0, 2, 7, 0, 0, 38, 12, 255, 255, 255, 240,
1728  0, 120, 0, 28, 0, 0, 6, 69, 82, 82, 79, 82, 33, 0
1729 };
1730 // "Cannot open file" text
1731 static const PROGMEM prog_uchar __bsod_badfile[31] =
1732 {
1733  12, 255, 255, 255, 240, 0, 148, 0, 28, 0, 0, 6, 67, 97, 110, 110, 111,
1734  116, 32, 111, 112, 101, 110, 32, 102, 105, 108, 101, 0, 0, 0
1735 };
1736 
1737 /*
1738 
1739 Now come the images we developed for the firmware.
1740 They are inserted here to not fill in another file.
1741 
1742 */
1743 static const PROGMEM prog_uchar __assets[9797] = {
1744 0, 0, 0, 5, 0, 0, 0, 1, 32, 64, 0, 8, 32, 128, 0, 7, 1, 0, 0, 5, 0,
1745 24, 1, 1, 22, 116, 2, 8, 22, 232, 4, 7, 2, 0, 0, 5, 240, 131, 1, 1,
1746 22, 116, 2, 8, 22, 232, 4, 7, 34, 255, 255, 255, 0, 0, 0, 0, 120, 156,
1747 237, 125, 125, 112, 91, 215, 117, 39, 50, 105, 90, 36, 253, 162, 252,
1748 71, 135, 78, 255, 176, 208, 52, 211, 65, 182, 155, 29, 82, 59, 187,
1749 133, 211, 25, 203, 140, 63, 50, 204, 180, 211, 37, 213, 217, 25, 40,
1750 153, 176, 97, 102, 147, 44, 181, 147, 164, 164, 166, 127, 192, 89,
1751 147, 48, 34, 81, 10, 164, 208, 50, 72, 209, 43, 80, 20, 36, 67, 54,
1752 233, 130, 46, 105, 3, 12, 161, 66, 148, 65, 23, 202, 80, 187, 160,
1753 135, 114, 65, 133, 84, 64, 42, 160, 250, 228, 66, 50, 32, 193, 22,
1754 100, 66, 18, 246, 158, 119, 241, 248, 190, 191, 0, 9, 138, 237, 115,
1755 126, 67, 94, 188, 143, 223, 123, 247, 221, 119, 222, 61, 247, 156,
1756 123, 223, 125, 22, 139, 190, 248, 11, 14, 166, 152, 246, 78, 182, 142,
1757 21, 211, 74, 219, 203, 207, 198, 138, 0, 87, 206, 153, 117, 102, 29,
1758 76, 99, 38, 181, 28, 78, 133, 83, 221, 73, 123, 208, 193, 192, 30,
1759 174, 92, 235, 152, 165, 23, 32, 61, 130, 43, 231, 202, 253, 69, 166,
1760 184, 12, 248, 215, 20, 176, 124, 139, 20, 13, 113, 216, 223, 51, 224,
1761 202, 193, 94, 54, 15, 229, 91, 3, 122, 185, 141, 21, 27, 51, 225, 197,
1762 182, 4, 199, 72, 12, 251, 11, 141, 25, 250, 219, 210, 219, 210, 111,
1763 224, 130, 201, 21, 39, 134, 225, 220, 78, 198, 51, 64, 206, 57, 210,
1764 152, 225, 242, 223, 54, 175, 197, 75, 23, 225, 10, 222, 88, 180, 7,
1765 45, 189, 54, 79, 235, 152, 119, 210, 30, 248, 20, 97, 117, 133, 156,
1766 89, 239, 100, 67, 188, 152, 142, 21, 245, 114, 15, 72, 45, 91, 3, 206,
1767 44, 252, 10, 133, 225, 172, 77, 137, 88, 209, 95, 112, 229, 96, 141,
1768 145, 252, 115, 199, 130, 92, 219, 60, 169, 148, 191, 192, 29, 219, 40,
1769 23, 238, 105, 114, 6, 206, 157, 139, 49, 254, 112, 74, 111, 127, 127,
1770 193, 153, 189, 149, 14, 147, 251, 150, 139, 133, 194, 222, 73, 235,
1771 72, 167, 215, 230, 177, 121, 154, 226, 164, 196, 122, 115, 51, 225,
1772 69, 216, 6, 247, 82, 75, 118, 102, 83, 169, 158, 100, 83, 188, 33, 30,
1773 244, 193, 185, 189, 147, 233, 18, 45, 1, 10, 114, 61, 186, 146, 46,
1774 158, 46, 238, 10, 89, 122, 59, 189, 192, 8, 167, 154, 18, 65, 31, 69,
1775 98, 216, 183, 168, 196, 136, 21, 29, 12, 104, 172, 47, 217, 148, 128,
1776 220, 183, 6, 233, 117, 231, 98, 80, 122, 68, 119, 76, 137, 191, 0,
1777 121, 63, 233, 131, 210, 246, 78, 130, 198, 57, 25, 51, 108, 162, 225,
1778 172, 214, 23, 211, 77, 241, 207, 6, 32, 39, 140, 223, 40, 59, 86, 4,
1779 70, 167, 55, 188, 200, 105, 63, 57, 191, 103, 97, 198, 40, 255, 0,
1780 155, 95, 82, 26, 41, 72, 91, 131, 13, 241, 198, 140, 113, 157, 217,
1781 18, 135, 242, 162, 79, 56, 232, 170, 81, 30, 149, 135, 51, 244, 126,
1782 153, 99, 241, 226, 202, 37, 124, 237, 154, 79, 39, 10, 10, 138, 88,
1783 160, 158, 32, 245, 85, 245, 194, 218, 232, 123, 193, 111, 204, 64, 29,
1784 221, 148, 168, 150, 79, 106, 14, 242, 155, 88, 139, 123, 192, 247, 45,
1785 118, 133, 186, 66, 14, 35, 245, 182, 34, 159, 218, 44, 67, 117, 153,
1786 46, 191, 59, 217, 16, 215, 40, 21, 93, 62, 180, 96, 8, 126, 67, 249,
1787 208, 90, 116, 102, 225, 23, 180, 219, 26, 51, 180, 165, 2, 45, 54,
1788 206, 242, 56, 179, 141, 25, 67, 119, 226, 62, 72, 106, 185, 117, 204,
1789 172, 29, 19, 10, 148, 137, 246, 17, 154, 18, 13, 113, 117, 116, 133,
1790 44, 108, 235, 81, 227, 8, 189, 70, 64, 142, 115, 159, 248, 53, 231,
1791 95, 83, 244, 203, 79, 91, 106, 189, 127, 40, 40, 40, 198, 196, 149,
1792 203, 197, 18, 195, 157, 222, 174, 16, 173, 195, 205, 73, 56, 69, 60,
1793 243, 74, 109, 67, 188, 231, 138, 24, 245, 88, 137, 207, 33, 174, 177,
1794 44, 96, 55, 236, 65, 26, 49, 80, 142, 90, 8, 197, 26, 16, 178, 193,
1795 158, 185, 114, 212, 127, 164, 208, 182, 228, 36, 143, 162, 179, 131,
1796 181, 166, 231, 230, 163, 14, 90, 158, 175, 148, 15, 54, 81, 90, 3, 19,
1797 95, 84, 67, 196, 103, 115, 48, 224, 185, 138, 145, 24, 214, 226, 59,
1798 179, 194, 171, 5, 143, 95, 202, 39, 219, 53, 197, 149, 19, 231, 193,
1799 132, 5, 218, 148, 198, 140, 240, 204, 185, 152, 131, 113, 48, 77, 9,
1800 104, 63, 216, 131, 234, 58, 229, 47, 192, 153, 61, 3, 77, 9, 216, 159,
1801 191, 114, 198, 159, 139, 25, 241, 221, 169, 141, 82, 131, 61, 168, 23,
1802 179, 16, 150, 28, 127, 102, 97, 201, 209, 246, 141, 154, 64, 164, 73,
1803 122, 175, 73, 123, 71, 148, 7, 45, 190, 252, 94, 179, 237, 37, 209,
1804 26, 173, 167, 200, 149, 227, 159, 60, 238, 108, 68, 131, 13, 243, 185,
1805 150, 31, 119, 181, 80, 94, 149, 54, 95, 5, 250, 49, 187, 98, 154, 62,
1806 129, 246, 96, 165, 172, 68, 103, 215, 127, 126, 65, 132, 117, 5, 175,
1807 139, 45, 253, 213, 68, 20, 252, 133, 174, 80, 167, 55, 49, 156, 139,
1808 233, 221, 125, 20, 148, 143, 139, 64, 140, 63, 49, 28, 244, 181, 142,
1809 105, 215, 88, 74, 226, 47, 112, 17, 114, 90, 11, 152, 109, 3, 8, 217,
1810 0, 229, 72, 173, 154, 200, 236, 127, 197, 98, 131, 253, 128, 24, 166,
1811 30, 159, 70, 186, 121, 4, 217, 232, 45, 191, 86, 207, 131, 145, 214,
1812 193, 197, 116, 186, 4, 177, 95, 30, 218, 145, 107, 177, 189, 239, 244,
1813 166, 75, 228, 250, 123, 165, 199, 212, 58, 130, 240, 108, 140, 63, 86,
1814 20, 215, 192, 0, 178, 135, 134, 208, 190, 2, 238, 252, 16, 179, 151,
1815 66, 173, 5, 225, 47, 132, 83, 169, 101, 40, 175, 182, 121, 185, 45,
1816 228, 161, 28, 37, 114, 48, 148, 147, 24, 110, 204, 164, 75, 177, 34,
1817 237, 245, 161, 53, 119, 98, 88, 104, 153, 148, 173, 160, 176, 213,
1818 225, 25, 176, 6, 248, 28, 180, 205, 199, 138, 233, 82, 106, 153, 150,
1819 4, 68, 181, 149, 248, 242, 114, 18, 106, 129, 111, 17, 242, 212, 157,
1820 108, 155, 87, 179, 3, 180, 159, 66, 140, 134, 56, 159, 111, 239, 164,
1821 182, 230, 200, 91, 31, 158, 129, 88, 81, 216, 254, 74, 106, 70, 239,
1822 83, 203, 82, 126, 119, 50, 93, 18, 223, 7, 237, 232, 137, 184, 221, 6,
1823 254, 178, 244, 105, 34, 247, 68, 67, 104, 143, 5, 127, 181, 177, 162,
1824 180, 69, 163, 221, 118, 5, 221, 75, 45, 39, 103, 184, 214, 154, 176,
1825 53, 97, 68, 243, 165, 210, 157, 20, 179, 181, 91, 79, 114, 17, 183,
1826 135, 180, 90, 158, 106, 210, 152, 1, 61, 12, 250, 186, 66, 228, 238,
1827 160, 160, 124, 68, 36, 86, 12, 167, 186, 66, 137, 225, 196, 112, 235,
1828 152, 121, 205, 21, 214, 3, 0, 179, 71, 144, 182, 0, 204, 61, 183, 82,
1829 143, 199, 44, 95, 94, 143, 210, 252, 59, 179, 197, 180, 145, 214, 144,
1830 244, 252, 80, 11, 59, 24, 174, 68, 140, 196, 68, 132, 117, 190, 53, 0,
1831 150, 139, 239, 195, 133, 53, 122, 145, 144, 198, 12, 191, 127, 119,
1832 210, 193, 8, 217, 0, 53, 63, 40, 181, 108, 15, 194, 200, 142, 116, 41,
1833 156, 226, 56, 77, 9, 241, 189, 164, 215, 160, 196, 230, 106, 107, 155,
1834 39, 156, 18, 94, 177, 28, 202, 237, 7, 161, 245, 177, 7, 187, 147, 82,
1835 207, 147, 135, 114, 47, 149, 186, 253, 110, 136, 183, 205, 11, 115,
1836 163, 172, 15, 74, 246, 155, 219, 223, 153, 77, 151, 120, 107, 162, 92,
1837 126, 82, 173, 133, 59, 197, 181, 97, 90, 250, 83, 203, 80, 170, 214,
1838 128, 53, 160, 86, 250, 82, 107, 101, 243, 56, 24, 190, 245, 5, 75,
1839 202, 60, 78, 196, 109, 5, 122, 23, 132, 87, 173, 239, 123, 211, 248,
1840 9, 128, 241, 67, 27, 76, 218, 242, 52, 166, 253, 225, 20, 205, 169,
1841 218, 115, 100, 84, 228, 81, 36, 115, 190, 136, 84, 255, 140, 140, 24,
1842 17, 138, 184, 245, 193, 248, 205, 91, 127, 223, 162, 53, 224, 25, 240,
1843 12, 128, 54, 99, 223, 3, 202, 71, 73, 192, 255, 98, 252, 157, 94, 207,
1844 64, 235, 152, 57, 15, 28, 196, 149, 19, 183, 252, 245, 218, 253, 82,
1845 145, 62, 251, 54, 143, 185, 209, 110, 82, 139, 103, 233, 53, 243, 244,
1846 146, 125, 101, 22, 192, 92, 254, 197, 182, 136, 218, 124, 24, 21, 169,
1847 119, 21, 48, 178, 15, 82, 97, 20, 1, 70, 190, 249, 11, 201, 25, 234,
1848 201, 181, 142, 169, 95, 9, 141, 82, 64, 77, 229, 47, 112, 126, 159,
1849 205, 227, 47, 20, 211, 66, 47, 48, 49, 172, 156, 11, 190, 182, 7, 207,
1850 175, 49, 67, 125, 159, 196, 176, 188, 253, 160, 60, 6, 65, 104, 255,
1851 90, 199, 96, 4, 168, 252, 46, 104, 89, 34, 113, 153, 217, 60, 234,
1852 246, 88, 57, 126, 160, 110, 255, 25, 191, 56, 39, 202, 237, 15, 121,
1853 79, 7, 101, 129, 229, 117, 229, 132, 222, 185, 114, 251, 71, 218, 94,
1854 105, 233, 119, 102, 233, 53, 180, 244, 131, 53, 229, 203, 71, 217, 14,
1855 138, 237, 183, 103, 0, 206, 202, 229, 27, 162, 104, 180, 85, 109, 243,
1856 168, 251, 224, 16, 171, 166, 163, 120, 26, 226, 254, 130, 48, 142,
1857 195, 61, 129, 176, 86, 141, 205, 229, 130, 238, 33, 237, 197, 49, 59,
1858 178, 71, 94, 154, 102, 158, 96, 242, 20, 200, 238, 133, 25, 190, 191,
1859 32, 213, 61, 35, 189, 78, 66, 17, 199, 241, 170, 177, 254, 212, 131,
1860 10, 250, 236, 65, 136, 63, 153, 101, 163, 160, 60, 88, 129, 104, 167,
1861 53, 16, 244, 49, 254, 228, 140, 249, 81, 87, 210, 24, 128, 118, 236,
1862 82, 46, 242, 190, 76, 115, 222, 131, 82, 95, 170, 25, 190, 220, 154,
1863 24, 233, 61, 44, 166, 155, 18, 52, 159, 210, 22, 140, 94, 244, 23,
1864 132, 187, 102, 40, 43, 161, 53, 97, 252, 70, 202, 95, 24, 119, 112,
1865 102, 249, 22, 0, 188, 245, 0, 17, 121, 123, 208, 51, 16, 244, 37, 103,
1866 212, 106, 50, 225, 232, 122, 136, 49, 112, 254, 27, 196, 244, 141,
1867 180, 31, 196, 37, 158, 24, 78, 45, 83, 27, 144, 24, 150, 214, 197,
1868 202, 22, 76, 43, 254, 46, 134, 81, 251, 173, 6, 229, 17, 12, 242, 158,
1869 14, 122, 69, 65, 31, 119, 37, 28, 148, 227, 15, 98, 251, 221, 233, 13,
1870 167, 184, 232, 121, 56, 21, 43, 10, 245, 65, 173, 255, 5, 90, 121, 65,
1871 31, 244, 93, 52, 37, 224, 158, 113, 199, 107, 233, 135, 119, 42, 120,
1872 190, 145, 40, 184, 51, 43, 124, 254, 160, 196, 57, 237, 50, 50, 46,
1873 86, 218, 11, 70, 223, 59, 224, 181, 91, 91, 228, 158, 191, 222, 152,
1874 17, 177, 200, 35, 63, 230, 90, 31, 242, 62, 64, 179, 99, 129, 107,
1875 183, 254, 14, 38, 57, 195, 248, 161, 246, 68, 235, 143, 242, 209, 148,
1876 88, 177, 41, 1, 49, 128, 196, 112, 40, 108, 190, 5, 16, 43, 10, 107,
1877 32, 45, 191, 69, 89, 164, 241, 80, 53, 191, 83, 77, 228, 241, 88, 237,
1878 145, 111, 32, 109, 243, 208, 231, 65, 223, 236, 147, 199, 175, 245,
1879 248, 188, 5, 33, 121, 87, 56, 63, 172, 85, 23, 222, 219, 163, 30, 50,
1880 223, 255, 77, 223, 32, 212, 107, 127, 8, 235, 44, 155, 7, 222, 191,
1881 228, 143, 102, 100, 236, 146, 248, 122, 97, 228, 0, 109, 17, 192, 8,
1882 8, 24, 77, 103, 13, 48, 126, 45, 95, 70, 234, 175, 67, 221, 71, 75,
1883 77, 60, 254, 1, 142, 172, 196, 215, 30, 53, 40, 132, 242, 155, 151,
1884 114, 125, 81, 131, 242, 91, 116, 98, 27, 13, 30, 35, 205, 63, 227,
1885 151, 182, 37, 213, 172, 25, 180, 152, 91, 199, 160, 148, 96, 220, 30,
1886 215, 251, 13, 35, 70, 196, 71, 214, 215, 67, 177, 255, 45, 140, 4, 0,
1887 244, 218, 210, 225, 84, 235, 152, 116, 127, 94, 27, 65, 55, 180, 216,
1888 242, 241, 38, 160, 141, 124, 52, 92, 239, 41, 84, 123, 110, 186, 147,
1889 252, 179, 101, 142, 111, 46, 250, 86, 107, 189, 1, 207, 177, 176, 244,
1890 212, 244, 85, 75, 156, 217, 228, 12, 140, 128, 102, 252, 240, 190,
1891 174, 89, 54, 10, 202, 111, 130, 128, 253, 135, 8, 64, 181, 253, 87,
1892 194, 152, 41, 227, 55, 98, 131, 252, 5, 232, 247, 165, 245, 147, 180,
1893 21, 31, 244, 233, 181, 194, 93, 57, 106, 131, 232, 155, 199, 242, 8,
1894 130, 182, 253, 21, 142, 86, 130, 104, 161, 124, 60, 150, 118, 11, 70,
1895 232, 63, 130, 133, 17, 91, 61, 253, 30, 92, 113, 107, 201, 95, 16, 30,
1896 47, 49, 108, 15, 234, 121, 125, 98, 255, 217, 59, 201, 197, 80, 187,
1897 66, 198, 70, 46, 75, 253, 103, 90, 26, 16, 61, 232, 78, 38, 103, 66,
1898 97, 189, 209, 147, 194, 246, 138, 248, 186, 133, 185, 82, 215, 35,
1899 113, 188, 90, 13, 218, 246, 163, 152, 78, 206, 116, 133, 188, 147, 48,
1900 74, 143, 234, 130, 180, 85, 162, 223, 11, 14, 194, 197, 251, 225, 62,
1901 136, 115, 165, 231, 137, 22, 211, 208, 110, 16, 142, 191, 16, 199,
1902 178, 181, 207, 47, 239, 107, 1, 207, 85, 216, 254, 208, 190, 126, 249,
1903 61, 128, 88, 3, 223, 146, 80, 139, 221, 112, 34, 247, 188, 33, 106,
1904 198, 249, 243, 116, 6, 14, 45, 241, 23, 164, 81, 28, 170, 51, 240, 62,
1905 7, 196, 52, 180, 217, 32, 92, 159, 9, 167, 187, 250, 12, 169, 64, 172,
1906 139, 122, 45, 13, 113, 180, 189, 40, 40, 181, 8, 140, 97, 9, 250, 172,
1907 1, 99, 81, 172, 88, 49, 23, 19, 206, 174, 34, 172, 143, 18, 195, 122,
1908 181, 135, 112, 212, 0, 88, 59, 97, 204, 147, 214, 229, 90, 53, 136,
1909 56, 254, 10, 245, 166, 188, 5, 160, 229, 57, 137, 253, 6, 216, 83,
1910 238, 137, 104, 213, 254, 98, 31, 15, 248, 242, 62, 8, 173, 249, 21,
1911 196, 150, 10, 124, 38, 249, 249, 181, 90, 48, 210, 189, 187, 147, 92,
1912 11, 6, 162, 254, 96, 193, 181, 99, 183, 106, 254, 179, 190, 199, 198,
1913 137, 188, 188, 105, 29, 110, 13, 36, 134, 173, 1, 35, 189, 72, 124,
1914 212, 84, 185, 45, 96, 188, 23, 73, 62, 118, 220, 200, 213, 52, 102,
1915 96, 244, 57, 255, 238, 161, 61, 40, 245, 134, 181, 102, 224, 145, 159,
1916 19, 246, 22, 183, 171, 180, 52, 72, 222, 131, 1, 250, 34, 141, 69,
1917 171, 243, 229, 35, 38, 96, 111, 113, 155, 64, 203, 23, 150, 223, 63,
1918 233, 83, 4, 177, 32, 117, 126, 172, 40, 205, 1, 88, 127, 190, 29, 239,
1919 25, 208, 27, 193, 39, 30, 55, 196, 69, 237, 125, 139, 137, 97, 207,
1920 64, 40, 108, 164, 253, 64, 173, 191, 103, 0, 227, 238, 40, 40, 230,
1921 197, 153, 13, 133, 161, 159, 152, 175, 39, 225, 93, 128, 182, 121,
1922 120, 175, 75, 159, 237, 19, 204, 54, 70, 219, 0, 14, 134, 171, 19,
1923 160, 71, 84, 155, 45, 174, 63, 97, 188, 174, 244, 237, 53, 173, 145,
1924 136, 177, 162, 248, 93, 39, 240, 124, 164, 254, 144, 205, 163, 222, 6,
1925 145, 198, 27, 192, 214, 202, 107, 84, 245, 158, 68, 169, 253, 12, 167,
1926 228, 227, 8, 181, 90, 0, 210, 94, 211, 92, 76, 218, 254, 1, 168, 199,
1927 142, 165, 111, 91, 117, 122, 149, 70, 208, 107, 149, 160, 51, 43, 111,
1928 177, 64, 173, 221, 16, 135, 185, 24, 67, 225, 174, 144, 222, 29, 132,
1929 218, 87, 122, 140, 182, 121, 136, 95, 107, 243, 164, 71, 113, 229,
1930 164, 165, 9, 185, 208, 211, 64, 152, 101, 178, 43, 212, 54, 15, 241,
1931 10, 165, 247, 15, 97, 76, 157, 58, 91, 233, 77, 199, 238, 164, 88,
1932 255, 180, 236, 159, 210, 120, 69, 103, 86, 106, 83, 213, 219, 96, 74,
1933 124, 127, 65, 218, 254, 80, 191, 127, 210, 62, 123, 170, 43, 210, 114,
1934 84, 143, 225, 72, 223, 254, 167, 109, 5, 113, 20, 12, 222, 72, 84, 47,
1935 65, 254, 173, 17, 122, 118, 216, 87, 216, 142, 227, 102, 4, 84, 151,
1936 98, 154, 43, 5, 198, 79, 219, 10, 124, 157, 0, 239, 80, 104, 179, 65,
1937 96, 228, 170, 111, 81, 56, 187, 166, 111, 17, 122, 112, 240, 253, 125,
1938 20, 148, 106, 69, 105, 86, 29, 53, 113, 48, 93, 33, 168, 57, 194, 169,
1939 78, 111, 114, 134, 62, 117, 198, 249, 52, 90, 106, 243, 248, 22, 105,
1940 77, 64, 235, 59, 51, 231, 23, 215, 216, 80, 227, 195, 8, 120, 35, 124,
1941 240, 254, 186, 147, 226, 90, 48, 232, 131, 119, 32, 100, 35, 154, 20,
1942 133, 143, 248, 195, 251, 190, 225, 20, 239, 207, 201, 234, 102, 69,
1943 225, 108, 22, 140, 248, 7, 112, 254, 84, 75, 191, 204, 51, 83, 20,
1944 110, 204, 23, 140, 54, 167, 160, 237, 31, 152, 179, 217, 88, 249, 81,
1945 27, 8, 111, 0, 10, 249, 161, 176, 204, 179, 85, 20, 174, 181, 37, 205,
1946 63, 235, 245, 26, 224, 243, 35, 16, 189, 147, 226, 242, 19, 142, 77,
1947 212, 186, 126, 155, 71, 60, 83, 0, 88, 161, 182, 121, 54, 242, 97,
1948 232, 250, 193, 195, 20, 183, 154, 232, 88, 61, 51, 250, 71, 243, 218,
1949 58, 70, 75, 131, 182, 247, 100, 179, 56, 105, 72, 99, 6, 102, 156,
1950 129, 231, 166, 43, 148, 139, 113, 62, 175, 48, 186, 99, 122, 102, 75,
1951 81, 14, 96, 52, 161, 121, 62, 175, 221, 166, 231, 229, 172, 8, 29,
1952 195, 160, 29, 65, 208, 22, 40, 209, 234, 103, 5, 134, 182, 129, 246,
1953 204, 23, 40, 40, 40, 74, 130, 246, 223, 8, 31, 237, 191, 114, 254, 31,
1954 188, 253, 55, 122, 253, 104, 255, 213, 5, 237, 63, 10, 202, 39, 83,
1955 208, 254, 27, 225, 163, 253, 87, 206, 63, 218, 127, 180, 255, 104,
1956 255, 81, 80, 126, 243, 197, 248, 91, 88, 202, 35, 153, 225, 157, 151,
1957 214, 49, 14, 48, 130, 138, 251, 13, 71, 230, 183, 48, 126, 165, 239,
1958 239, 65, 143, 57, 111, 189, 96, 54, 124, 87, 142, 91, 130, 109, 254,
1959 2, 183, 4, 125, 227, 242, 30, 61, 176, 211, 48, 215, 43, 5, 180, 37,
1960 248, 165, 116, 9, 250, 99, 249, 99, 195, 12, 105, 82, 62, 124, 33,
1961 142, 223, 31, 70, 99, 243, 75, 233, 18, 124, 1, 142, 95, 130, 241,
1962 197, 82, 62, 244, 150, 194, 183, 238, 56, 104, 47, 201, 71, 55, 195,
1963 119, 143, 236, 65, 14, 240, 230, 60, 191, 100, 15, 130, 117, 227, 151,
1964 96, 95, 49, 27, 174, 9, 230, 153, 227, 0, 111, 92, 9, 243, 207, 248,
1965 97, 46, 66, 14, 180, 172, 132, 124, 152, 65, 128, 47, 239, 116, 9,
1966 222, 254, 16, 242, 225, 189, 116, 126, 9, 238, 135, 184, 63, 189, 59,
1967 9, 243, 21, 243, 200, 197, 90, 199, 132, 203, 96, 19, 133, 203, 157,
1968 94, 241, 120, 198, 80, 216, 30, 20, 110, 135, 175, 7, 10, 151, 189,
1969 147, 201, 25, 225, 178, 61, 40, 30, 15, 8, 54, 178, 165, 159, 7, 148,
1970 178, 214, 178, 84, 135, 97, 158, 97, 152, 161, 143, 67, 75, 63, 188,
1971 139, 207, 195, 51, 208, 210, 47, 92, 134, 55, 188, 120, 54, 104, 155,
1972 131, 17, 151, 87, 219, 188, 112, 185, 41, 33, 190, 62, 40, 111, 222,
1973 22, 67, 239, 185, 80, 91, 65, 195, 96, 214, 97, 225, 253, 100, 252,
1974 194, 101, 120, 62, 248, 62, 241, 134, 184, 248, 110, 167, 75, 158, 1,
1975 152, 3, 144, 71, 56, 37, 212, 110, 128, 240, 43, 91, 240, 141, 74,
1976 241, 214, 150, 126, 190, 37, 72, 53, 70, 124, 127, 211, 37, 248, 54,
1977 22, 175, 187, 66, 237, 0, 72, 203, 3, 230, 165, 20, 239, 1, 121, 222,
1978 44, 192, 94, 97, 205, 33, 173, 61, 228, 53, 8, 173, 69, 200, 115, 84,
1979 17, 181, 217, 166, 180, 193, 243, 81, 80, 62, 233, 146, 15, 185, 178,
1980 48, 211, 152, 16, 174, 108, 222, 224, 91, 56, 205, 209, 116, 105, 215,
1981 136, 35, 35, 253, 115, 25, 154, 183, 51, 79, 106, 159, 114, 121, 215,
1982 200, 224, 188, 244, 207, 152, 191, 226, 202, 150, 203, 192, 143, 36,
1983 165, 127, 198, 248, 254, 194, 174, 145, 178, 162, 212, 139, 175, 204,
1984 70, 62, 242, 141, 240, 169, 254, 43, 137, 193, 231, 143, 60, 251, 35,
1985 5, 57, 140, 63, 255, 40, 40, 40, 31, 85, 217, 53, 178, 48, 150, 15,
1986 25, 195, 194, 216, 174, 17, 41, 127, 105, 81, 173, 254, 81, 146, 37,
1987 217, 56, 230, 116, 209, 12, 63, 45, 139, 34, 214, 122, 254, 90, 175,
1988 191, 86, 193, 242, 199, 242, 255, 36, 151, 63, 10, 10, 202, 131, 149,
1989 212, 134, 245, 142, 237, 182, 197, 20, 152, 219, 169, 155, 148, 221,
1990 182, 193, 220, 182, 223, 241, 220, 110, 49, 1, 246, 24, 87, 27, 254,
1991 29, 206, 205, 220, 110, 187, 27, 186, 19, 36, 107, 59, 13, 243, 217,
1992 220, 174, 91, 222, 74, 253, 155, 245, 67, 251, 29, 96, 195, 26, 83,
1993 215, 112, 203, 178, 102, 121, 131, 249, 71, 219, 109, 207, 109, 150,
1994 125, 75, 25, 80, 107, 42, 110, 201, 91, 222, 177, 188, 100, 235, 183,
1995 112, 249, 145, 237, 97, 187, 213, 185, 201, 239, 188, 213, 34, 221,
1996 126, 213, 242, 182, 5, 222, 153, 99, 175, 91, 137, 79, 153, 194, 255,
1997 18, 254, 255, 229, 248, 45, 192, 126, 95, 10, 150, 35, 250, 47, 66,
1998 173, 252, 43, 18, 126, 158, 71, 103, 190, 97, 195, 146, 103, 57, 162,
1999 255, 34, 92, 177, 252, 66, 141, 47, 103, 234, 242, 225, 122, 54, 193,
2000 238, 173, 240, 95, 132, 117, 194, 247, 213, 196, 127, 75, 159, 31,
2001 222, 128, 255, 221, 55, 21, 248, 107, 34, 62, 92, 79, 5, 157, 87, 96,
2002 239, 226, 6, 111, 181, 93, 236, 127, 126, 15, 22, 170, 252, 196, 21,
2003 101, 219, 79, 183, 218, 8, 20, 248, 112, 61, 21, 88, 223, 85, 225,
2004 147, 109, 204, 85, 238, 151, 229, 162, 229, 140, 50, 191, 85, 149,
2005 223, 178, 206, 31, 73, 194, 135, 252, 84, 208, 122, 89, 153, 223, 122,
2006 205, 199, 150, 35, 169, 119, 96, 191, 11, 102, 249, 254, 74, 106, 125,
2007 183, 194, 255, 103, 115, 124, 42, 206, 82, 101, 63, 49, 31, 174, 167,
2008 2, 235, 37, 45, 126, 231, 90, 101, 191, 119, 4, 252, 91, 66, 126, 98,
2009 77, 157, 29, 122, 119, 115, 63, 224, 15, 108, 242, 33, 63, 21, 116,
2010 94, 84, 99, 251, 75, 252, 94, 164, 246, 249, 185, 10, 255, 66, 90,
2011 133, 239, 185, 160, 194, 127, 159, 205, 207, 38, 66, 138, 37, 152,
2012 123, 87, 184, 15, 169, 61, 222, 80, 227, 91, 222, 73, 221, 144, 178,
2013 137, 173, 120, 71, 145, 79, 234, 34, 219, 58, 155, 31, 17, 186, 46,
2014 197, 54, 185, 190, 247, 58, 223, 145, 110, 39, 218, 255, 143, 150,
2015 126, 91, 63, 3, 92, 56, 218, 47, 76, 225, 140, 229, 159, 224, 238, 89,
2016 3, 169, 247, 200, 145, 206, 144, 123, 241, 115, 146, 31, 99, 248, 39,
2017 130, 87, 216, 123, 207, 206, 119, 211, 176, 76, 150, 142, 145, 229, 1,
2018 195, 240, 90, 216, 209, 78, 77, 149, 183, 245, 83, 191, 102, 94, 177,
2019 245, 115, 176, 104, 246, 136, 113, 123, 89, 3, 252, 91, 185, 131, 75,
2020 79, 143, 110, 125, 206, 28, 158, 30, 29, 90, 161, 236, 231, 207, 126,
2021 119, 244, 123, 39, 158, 120, 225, 241, 189, 198, 1, 71, 56, 230, 206,
2022 199, 225, 220, 255, 227, 200, 212, 185, 3, 211, 79, 188, 208, 242, 83,
2023 99, 224, 248, 29, 238, 237, 125, 127, 180, 242, 244, 232, 247, 95, 6,
2024 182, 217, 252, 175, 185, 183, 186, 143, 245, 50, 254, 173, 207, 61,
2025 241, 2, 176, 45, 10, 120, 234, 200, 237, 194, 237, 194, 83, 71, 148,
2026 182, 29, 115, 175, 245, 109, 237, 181, 121, 182, 62, 247, 248, 222,
2027 150, 159, 42, 243, 223, 56, 15, 218, 247, 198, 121, 101, 254, 177, 62,
2028 184, 31, 90, 252, 200, 10, 240, 35, 43, 74, 219, 122, 37, 252, 53, 55,
2029 135, 75, 123, 126, 48, 251, 195, 185, 75, 123, 214, 220, 28, 31, 214,
2030 253, 112, 238, 7, 179, 176, 142, 67, 175, 187, 87, 192, 183, 60, 119,
2031 198, 77, 113, 105, 207, 207, 51, 192, 250, 209, 217, 51, 155, 252, 51,
2032 238, 31, 157, 133, 95, 191, 100, 46, 237, 225, 246, 83, 227, 79, 175,
2033 210, 103, 238, 133, 5, 33, 255, 133, 5, 186, 118, 122, 149, 219, 175,
2034 195, 221, 161, 192, 255, 235, 83, 116, 191, 229, 108, 230, 224, 25,
2035 247, 16, 203, 31, 34, 252, 204, 193, 229, 74, 156, 251, 175, 79, 41,
2036 243, 73, 121, 186, 223, 220, 115, 135, 245, 166, 87, 114, 241, 253,
2037 176, 204, 241, 225, 119, 124, 255, 74, 14, 150, 238, 20, 223, 220, 3,
2038 203, 219, 69, 252, 53, 55, 172, 251, 143, 211, 244, 28, 204, 209, 99,
2039 110, 41, 255, 152, 155, 57, 74, 183, 254, 249, 235, 148, 191, 93, 196,
2040 39, 229, 81, 217, 127, 134, 233, 117, 247, 10, 150, 135, 86, 184, 229,
2041 25, 6, 150, 7, 151, 224, 183, 144, 255, 248, 94, 182, 60, 221, 52,
2042 135, 127, 51, 199, 237, 223, 205, 150, 90, 247, 2, 183, 252, 55, 115,
2043 244, 234, 148, 248, 164, 60, 220, 119, 75, 176, 253, 247, 94, 239,
2044 112, 83, 156, 56, 120, 120, 245, 240, 234, 137, 131, 220, 242, 239,
2045 189, 14, 219, 239, 150, 224, 247, 86, 247, 86, 1, 255, 24, 187, 157,
2046 150, 222, 239, 79, 115, 251, 75, 241, 251, 108, 249, 252, 170, 8, 191,
2047 45, 18, 62, 201, 143, 59, 202, 222, 163, 182, 115, 219, 221, 202, 104,
2048 59, 7, 219, 163, 89, 248, 173, 196, 111, 103, 175, 247, 98, 65, 141,
2049 127, 145, 237, 43, 105, 95, 144, 243, 217, 242, 112, 191, 114, 156,
2050 222, 161, 63, 56, 165, 196, 254, 131, 138, 110, 189, 114, 28, 150,
2051 214, 250, 44, 34, 254, 86, 22, 209, 138, 150, 237, 61, 186, 213, 45,
2052 198, 222, 163, 180, 116, 163, 89, 186, 44, 228, 111, 127, 174, 163,
2053 178, 87, 127, 37, 7, 119, 75, 215, 34, 66, 246, 181, 8, 101, 151, 203,
2054 253, 199, 229, 252, 173, 207, 193, 245, 80, 252, 225, 44, 103, 181,
2055 46, 22, 154, 207, 93, 139, 92, 139, 52, 159, 187, 184, 217, 71, 244,
2056 135, 179, 220, 126, 103, 250, 214, 122, 149, 248, 22, 119, 195, 92,
2057 89, 69, 26, 230, 248, 189, 164, 252, 181, 62, 30, 251, 78, 158, 202,
2058 73, 185, 167, 114, 251, 78, 10, 247, 57, 38, 226, 111, 21, 241, 1,
2059 251, 199, 255, 118, 137, 30, 229, 84, 238, 111, 151, 246, 143, 75,
2060 183, 247, 246, 157, 17, 241, 207, 244, 153, 3, 199, 167, 117, 217,
2061 154, 73, 246, 153, 190, 237, 125, 29, 236, 56, 144, 189, 71, 161, 44,
2062 122, 89, 116, 84, 82, 109, 192, 94, 91, 251, 142, 85, 70, 195, 253,
2063 151, 149, 237, 100, 201, 66, 74, 227, 152, 9, 116, 84, 172, 49, 216,
2064 224, 31, 198, 185, 37, 179, 224, 70, 241, 192, 151, 74, 132, 35, 204,
2065 52, 237, 127, 101, 47, 161, 253, 71, 255, 95, 217, 255, 79, 220, 246,
2066 19, 175, 33, 161, 28, 27, 208, 245, 255, 45, 183, 124, 119, 65, 255,
2067 125, 119, 21, 249, 186, 254, 191, 229, 86, 138, 229, 167, 212, 248,
2068 42, 254, 187, 237, 253, 134, 141, 134, 13, 27, 249, 181, 201, 23, 172,
2069 211, 243, 255, 109, 239, 59, 216, 231, 189, 105, 67, 200, 111, 98,
2070 189, 81, 71, 217, 166, 235, 255, 23, 239, 210, 250, 162, 123, 195,
2071 146, 79, 177, 172, 20, 249, 213, 93, 241, 102, 139, 119, 181, 253,
2072 255, 228, 7, 116, 63, 103, 185, 51, 47, 228, 119, 230, 157, 149, 122,
2073 40, 249, 129, 186, 255, 223, 146, 167, 109, 126, 87, 185, 37, 15, 203,
2074 155, 124, 118, 27, 245, 162, 99, 149, 109, 74, 254, 127, 168, 114,
2075 118, 235, 117, 234, 163, 11, 249, 150, 171, 214, 235, 116, 171, 247,
2076 3, 53, 255, 159, 238, 239, 40, 113, 62, 190, 152, 111, 185, 234, 40,
2077 9, 150, 21, 252, 119, 154, 195, 134, 155, 156, 39, 79, 227, 6, 221,
2078 155, 203, 13, 55, 233, 213, 169, 249, 255, 212, 111, 11, 93, 231, 246,
2079 247, 92, 41, 110, 20, 55, 60, 155, 145, 129, 16, 123, 5, 105, 37, 62,
2080 235, 191, 199, 56, 254, 186, 50, 40, 63, 166, 234, 255, 59, 217, 235,
2081 107, 187, 169, 198, 111, 99, 243, 79, 60, 104, 21, 255, 159, 94, 175,
2082 191, 76, 252, 185, 53, 57, 108, 235, 212, 131, 239, 86, 245, 255, 237,
2083 149, 200, 67, 242, 154, 18, 63, 121, 173, 114, 119, 53, 252, 127, 103,
2084 197, 74, 51, 178, 28, 48, 235, 180, 116, 181, 253, 127, 107, 197, 243,
2085 77, 67, 30, 46, 242, 72, 94, 227, 124, 106, 235, 101, 109, 255, 63,
2086 119, 141, 179, 184, 254, 82, 219, 141, 208, 187, 161, 119, 219, 110,
2087 248, 75, 220, 186, 220, 53, 125, 255, 191, 233, 189, 178, 138, 52,
2088 189, 103, 196, 255, 183, 92, 176, 95, 118, 149, 164, 92, 87, 201, 126,
2089 217, 98, 208, 255, 39, 184, 208, 122, 57, 124, 131, 30, 197, 85, 10,
2090 223, 104, 189, 204, 122, 217, 134, 253, 127, 3, 208, 241, 255, 117,
2091 129, 254, 63, 250, 255, 58, 254, 191, 229, 185, 240, 82, 120, 73, 121,
2092 139, 186, 255, 255, 133, 159, 13, 204, 125, 106, 47, 253, 253, 75,
2093 230, 151, 12, 253, 245, 169, 189, 3, 115, 95, 248, 153, 17, 255, 255,
2094 107, 39, 202, 229, 231, 207, 74, 249, 207, 19, 15, 252, 107, 39, 140,
2095 248, 255, 212, 239, 255, 204, 97, 248, 245, 131, 217, 31, 204, 66,
2096 250, 153, 195, 52, 14, 160, 239, 255, 3, 126, 235, 133, 229, 236, 159,
2097 141, 10, 215, 252, 217, 232, 114, 246, 183, 94, 16, 174, 145, 243,
2098 127, 103, 116, 112, 233, 183, 143, 112, 219, 127, 189, 255, 175, 166,
2099 135, 86, 150, 179, 191, 100, 124, 231, 255, 195, 107, 60, 239, 183,
2100 143, 248, 206, 255, 206, 168, 146, 255, 111, 61, 1, 254, 167, 239,
2101 252, 155, 123, 32, 14, 0, 254, 210, 157, 226, 12, 185, 126, 248, 117,
2102 177, 240, 217, 151, 207, 16, 255, 222, 119, 30, 214, 90, 79, 40, 251,
2103 255, 241, 253, 63, 58, 11, 190, 63, 68, 43, 102, 24, 235, 9, 234, 183,
2104 191, 185, 231, 207, 95, 7, 15, 234, 115, 175, 66, 12, 224, 71, 103,
2105 105, 108, 64, 201, 255, 167, 184, 114, 156, 247, 249, 223, 58, 196,
2106 28, 13, 236, 57, 230, 158, 59, 120, 177, 112, 167, 120, 124, 63, 191,
2107 215, 118, 5, 255, 159, 162, 135, 228, 113, 238, 32, 253, 205, 28, 253,
2108 251, 115, 209, 236, 149, 227, 189, 238, 223, 125, 13, 34, 7, 252, 94,
2109 219, 37, 254, 251, 231, 94, 253, 242, 169, 47, 159, 250, 220, 171,
2110 189, 238, 159, 103, 126, 85, 236, 21, 28, 239, 196, 65, 136, 32, 252,
2111 203, 16, 141, 12, 112, 251, 73, 249, 212, 71, 188, 88, 232, 112, 15,
2112 173, 220, 45, 245, 237, 17, 250, 237, 189, 228, 239, 23, 228, 170,
2113 190, 124, 170, 99, 115, 63, 185, 255, 223, 183, 135, 178, 192, 203,
2114 255, 79, 179, 82, 223, 255, 240, 106, 185, 28, 28, 234, 216, 220, 79,
2115 201, 127, 167, 232, 96, 227, 28, 87, 167, 182, 11, 214, 129, 103, 47,
2116 142, 11, 40, 243, 255, 110, 207, 203, 71, 183, 187, 191, 205, 198,
2117 106, 224, 215, 246, 77, 207, 125, 247, 18, 252, 122, 249, 232, 223,
2118 237, 81, 226, 179, 229, 233, 190, 58, 5, 87, 215, 121, 112, 187, 251,
2119 39, 67, 160, 1, 116, 207, 206, 131, 119, 75, 167, 114, 143, 239, 129,
2120 95, 112, 229, 52, 103, 114, 255, 255, 90, 4, 56, 175, 84, 252, 243,
2121 230, 115, 92, 20, 0, 60, 242, 249, 113, 186, 246, 149, 227, 112, 109,
2122 224, 219, 203, 253, 255, 150, 253, 28, 23, 240, 94, 180, 92, 126, 145,
2123 217, 189, 180, 123, 9, 174, 101, 207, 255, 225, 183, 188, 114, 188,
2124 101, 191, 186, 255, 207, 33, 42, 26, 215, 217, 124, 78, 186, 93, 221,
2125 255, 167, 248, 135, 85, 33, 159, 143, 27, 24, 241, 255, 1, 98, 126,
2126 238, 180, 116, 187, 158, 255, 255, 255, 34, 66, 254, 147, 67, 102,
2127 253, 255, 63, 61, 196, 229, 224, 110, 233, 63, 159, 191, 244, 147,
2128 106, 252, 255, 100, 52, 93, 250, 231, 194, 247, 142, 163, 255, 47,
2129 176, 255, 232, 255, 155, 234, 255, 87, 133, 1, 255, 95, 19, 6, 252,
2130 127, 29, 190, 78, 255, 189, 14, 106, 229, 107, 244, 255, 3, 90, 242,
2131 201, 15, 83, 27, 206, 178, 163, 236, 219, 232, 250, 192, 150, 151,
2132 110, 87, 239, 255, 183, 177, 113, 0, 240, 151, 98, 132, 237, 40, 195,
2133 47, 127, 217, 254, 1, 221, 162, 223, 255, 223, 153, 135, 104, 133, 99,
2134 211, 139, 183, 93, 245, 126, 0, 158, 99, 235, 7, 157, 121, 35, 253,
2135 255, 224, 231, 167, 54, 108, 236, 111, 79, 158, 201, 195, 175, 206,
2136 171, 126, 136, 28, 24, 234, 255, 247, 145, 179, 123, 42, 191, 153,
2137 124, 219, 77, 39, 155, 147, 46, 114, 84, 239, 117, 35, 253, 255, 142,
2138 82, 76, 212, 215, 239, 185, 90, 220, 176, 92, 9, 94, 37, 254, 219, 77,
2139 193, 122, 85, 126, 106, 35, 93, 182, 137, 198, 10, 192, 146, 149, 248,
2140 149, 201, 235, 170, 252, 171, 98, 47, 63, 39, 139, 1, 192, 120, 132,
2141 224, 21, 193, 26, 213, 254, 127, 219, 58, 196, 57, 188, 215, 132, 108,
2142 240, 236, 37, 113, 1, 213, 254, 127, 203, 90, 203, 58, 120, 142, 204,
2143 230, 186, 28, 201, 81, 24, 216, 66, 143, 92, 181, 255, 31, 16, 92,
2144 231, 61, 245, 78, 226, 185, 187, 74, 54, 105, 60, 64, 181, 255, 159,
2145 162, 237, 6, 23, 5, 0, 143, 188, 245, 93, 89, 60, 65, 181, 255, 159,
2146 243, 248, 33, 18, 20, 190, 25, 190, 9, 215, 146, 144, 109, 87, 239,
2147 255, 167, 112, 138, 60, 240, 182, 27, 138, 124, 21, 255, 29, 80, 188,
2148 41, 178, 223, 215, 164, 219, 181, 252, 127, 211, 124, 5, 255, 61, 36,
2149 26, 5, 18, 148, 251, 247, 58, 254, 191, 103, 51, 7, 233, 178, 239,
2150 134, 173, 42, 255, 63, 121, 57, 93, 246, 151, 236, 191, 66, 255, 95,
2151 96, 255, 21, 252, 255, 116, 97, 117, 181, 188, 176, 122, 174, 124,
2152 110, 245, 44, 1, 253, 175, 137, 209, 185, 175, 156, 117, 49, 28, 187,
2153 156, 35, 88, 34, 124, 114, 12, 99, 248, 241, 220, 133, 169, 135, 78,
2154 194, 104, 100, 150, 93, 46, 23, 86, 207, 127, 115, 238, 199, 115, 223,
2155 52, 128, 111, 16, 124, 254, 212, 208, 196, 245, 224, 215, 95, 108, 92,
2156 77, 175, 18, 126, 97, 100, 225, 66, 36, 50, 53, 61, 53, 100, 24, 59,
2157 198, 223, 14, 88, 159, 111, 13, 146, 92, 47, 157, 38, 236, 158, 9,
2158 115, 216, 54, 62, 49, 114, 210, 219, 226, 25, 157, 155, 61, 251, 151,
2159 115, 228, 120, 19, 230, 208, 60, 126, 96, 196, 67, 238, 226, 81, 194,
2160 255, 10, 240, 199, 205, 225, 161, 147, 148, 255, 227, 185, 163, 103,
2161 63, 63, 187, 123, 162, 125, 220, 28, 30, 58, 185, 235, 197, 239, 0,
2162 127, 246, 127, 179, 252, 109, 227, 20, 211, 113, 238, 153, 157, 142,
2163 107, 173, 219, 82, 225, 127, 99, 246, 199, 115, 15, 207, 246, 108,
2164 242, 133, 79, 189, 214, 58, 158, 255, 205, 185, 15, 163, 80, 30, 20,
2165 34, 175, 71, 99, 221, 245, 224, 174, 23, 59, 9, 255, 47, 103, 191,
2166 193, 242, 31, 26, 167, 16, 238, 171, 181, 46, 79, 180, 7, 248, 95, 57,
2167 245, 141, 185, 91, 209, 246, 241, 106, 249, 127, 124, 234, 43, 179,
2168 23, 162, 112, 61, 20, 194, 125, 181, 214, 229, 3, 148, 255, 249, 42,
2169 249, 111, 3, 159, 60, 233, 27, 209, 207, 207, 78, 71, 160, 60, 40,
2170 132, 251, 106, 173, 91, 8, 124, 125, 16, 248, 31, 70, 128, 15, 215,
2171 67, 33, 220, 87, 107, 221, 66, 160, 181, 194, 255, 48, 26, 137, 108,
2172 49, 205, 127, 45, 240, 37, 150, 127, 129, 240, 135, 34, 228, 122, 130,
2173 20, 194, 125, 181, 214, 77, 108, 242, 111, 69, 7, 35, 112, 61, 20,
2174 194, 125, 181, 214, 113, 252, 233, 169, 11, 209, 221, 83, 121, 243,
2175 252, 145, 47, 13, 126, 149, 240, 35, 83, 75, 145, 106, 248, 7, 70,
2176 236, 44, 127, 104, 106, 58, 210, 67, 248, 19, 1, 10, 225, 190, 90,
2177 235, 14, 140, 124, 150, 229, 15, 78, 69, 34, 59, 166, 22, 54, 249,
2178 237, 81, 110, 207, 246, 168, 214, 58, 142, 191, 123, 106, 40, 210, 62,
2179 181, 16, 152, 48, 9, 47, 225, 183, 16, 126, 207, 196, 224, 212, 182,
2180 9, 184, 30, 115, 216, 245, 162, 245, 121, 224, 239, 152, 216, 61, 213,
2181 60, 49, 81, 5, 255, 202, 0, 240, 161, 46, 200, 7, 15, 152, 230, 183,
2182 190, 152, 240, 218, 136, 55, 220, 28, 153, 96, 143, 246, 117, 83, 248,
2183 210, 32, 51, 0, 218, 99, 13, 56, 86, 191, 244, 162, 125, 240, 179,
2184 131, 214, 231, 175, 12, 24, 3, 67, 144, 240, 118, 122, 56, 251, 239,
2185 155, 79, 120, 127, 210, 223, 233, 105, 49, 1, 27, 107, 203, 185, 175,
2186 245, 20, 211, 246, 0, 157, 231, 68, 63, 2, 64, 247, 104, 65, 251, 143,
2187 246, 95, 209, 254, 111, 27, 127, 116, 101, 103, 166, 39, 194, 47, 43,
2188 67, 205, 254, 111, 27, 143, 65, 132, 185, 244, 240, 249, 109, 19, 198,
2189 248, 98, 251, 223, 76, 249, 68, 98, 133, 72, 156, 95, 43, 133, 154,
2190 253, 127, 104, 147, 15, 226, 98, 122, 162, 252, 22, 33, 212, 236, 191,
2191 152, 15, 226, 88, 105, 158, 80, 231, 75, 237, 255, 150, 147, 82, 62,
2192 188, 181, 183, 52, 255, 144, 96, 15, 45, 251, 175, 196, 7, 241, 103,
2193 123, 162, 66, 190, 154, 253, 191, 30, 84, 230, 131, 60, 188, 194, 239,
2194 165, 102, 255, 243, 154, 124, 126, 47, 53, 251, 175, 198, 247, 103,
2195 219, 35, 252, 62, 234, 246, 255, 109, 5, 254, 233, 98, 56, 145, 15,
2196 190, 45, 130, 154, 253, 95, 8, 72, 249, 183, 82, 249, 49, 126, 171,
2197 158, 253, 23, 243, 119, 50, 205, 83, 114, 174, 150, 253, 231, 249,
2198 177, 66, 207, 105, 101, 174, 150, 253, 159, 96, 249, 233, 210, 82,
2199 114, 33, 168, 101, 127, 213, 236, 255, 68, 224, 86, 202, 177, 154, 15,
2200 233, 217, 111, 180, 255, 104, 255, 209, 254, 127, 188, 237, 255, 96,
2201 212, 159, 245, 103, 7, 163, 240, 251, 209, 149, 88, 46, 150, 115, 174,
2202 234, 219, 127, 14, 145, 120, 154, 141, 65, 166, 75, 145, 211, 219,
2203 198, 159, 97, 199, 174, 143, 228, 244, 237, 63, 197, 210, 60, 173, 3,
2204 105, 109, 184, 52, 175, 206, 151, 218, 127, 192, 195, 75, 212, 102,
2205 236, 152, 218, 49, 229, 103, 123, 66, 87, 75, 148, 175, 111, 255, 155,
2206 199, 119, 178, 111, 48, 56, 87, 119, 68, 70, 114, 35, 185, 29, 17,
2207 231, 42, 87, 159, 143, 228, 244, 236, 127, 123, 229, 124, 183, 22,
2208 123, 162, 244, 221, 252, 116, 177, 39, 122, 107, 81, 141, 47, 182,
2209 255, 59, 34, 244, 122, 35, 137, 72, 188, 204, 71, 112, 75, 145, 120,
2210 36, 65, 203, 178, 61, 162, 110, 255, 7, 79, 67, 137, 179, 231, 75, 74,
2211 109, 96, 49, 73, 243, 147, 46, 13, 158, 86, 182, 255, 244, 12, 177,
2212 66, 123, 196, 177, 162, 100, 129, 29, 43, 237, 155, 185, 83, 178, 255,
2213 143, 174, 194, 156, 65, 205, 83, 46, 70, 137, 13, 226, 34, 214, 16,
2214 230, 27, 122, 116, 85, 201, 254, 95, 31, 91, 74, 230, 131, 234, 108,
2215 122, 132, 124, 112, 41, 121, 125, 76, 221, 254, 251, 101, 35, 207,
2216 133, 226, 207, 233, 217, 127, 61, 190, 158, 253, 55, 204, 87, 177,
2217 255, 70, 249, 106, 246, 95, 143, 175, 103, 255, 205, 242, 165, 246,
2218 127, 105, 49, 86, 84, 71, 42, 137, 246, 31, 237, 255, 39, 197, 254,
2219 239, 158, 120, 38, 243, 76, 102, 119, 149, 246, 191, 103, 130, 218,
2220 188, 103, 152, 158, 106, 236, 127, 133, 77, 143, 64, 24, 166, 236,
2221 255, 142, 9, 113, 61, 236, 34, 71, 48, 234, 255, 3, 6, 35, 101, 137,
2222 236, 150, 68, 4, 244, 236, 127, 79, 132, 180, 62, 114, 180, 206, 25,
2223 140, 202, 227, 9, 218, 246, 159, 226, 25, 214, 18, 63, 147, 53, 238,
2224 255, 55, 143, 11, 253, 125, 142, 207, 175, 233, 137, 54, 107, 216,
2225 127, 218, 114, 232, 137, 168, 241, 123, 72, 169, 236, 204, 52, 171,
2226 216, 255, 135, 42, 237, 14, 106, 159, 1, 220, 253, 231, 150, 7, 79,
2227 195, 242, 206, 12, 196, 2, 228, 246, 159, 178, 161, 213, 179, 51, 195,
2228 130, 225, 218, 31, 59, 25, 88, 218, 153, 241, 87, 198, 132, 237, 204,
2229 200, 237, 63, 88, 111, 227, 242, 232, 170, 212, 254, 155, 227, 59, 86,
2230 229, 246, 223, 89, 201, 255, 51, 92, 254, 51, 155, 249, 175, 44, 63,
2231 83, 201, 191, 51, 163, 100, 255, 185, 35, 244, 68, 57, 27, 79, 117,
2232 216, 197, 112, 203, 61, 81, 142, 173, 108, 255, 233, 17, 120, 143,
2233 157, 227, 115, 203, 205, 83, 148, 173, 101, 255, 133, 254, 190, 148,
2234 47, 220, 170, 238, 255, 107, 241, 141, 248, 255, 20, 91, 38, 182, 76,
2235 113, 250, 183, 101, 106, 203, 132, 113, 255, 159, 178, 165, 119, 76,
2236 122, 4, 61, 255, 159, 187, 155, 220, 29, 51, 235, 255, 11, 143, 0,
2237 108, 243, 246, 159, 59, 194, 163, 10, 108, 131, 246, 159, 88, 103,
2238 199, 170, 242, 54, 180, 255, 156, 253, 239, 78, 122, 39, 97, 70, 111,
2239 41, 188, 147, 90, 95, 141, 231, 164, 59, 217, 148, 80, 171, 37, 154,
2240 18, 250, 71, 240, 78, 106, 213, 51, 250, 95, 238, 232, 10, 105, 241,
2241 229, 115, 237, 35, 31, 249, 247, 146, 95, 171, 254, 250, 22, 213, 159,
2242 159, 134, 184, 145, 39, 208, 183, 88, 203, 243, 139, 130, 130, 242,
2243 73, 150, 143, 163, 253, 247, 45, 182, 244, 59, 152, 106, 235, 127,
2244 250, 221, 191, 150, 254, 234, 248, 240, 189, 19, 224, 135, 194, 198,
2245 249, 240, 197, 23, 202, 134, 175, 15, 1, 155, 174, 55, 198, 135, 239,
2246 12, 90, 217, 81, 66, 174, 28, 253, 14, 158, 189, 50, 102, 202, 24,
2247 159, 114, 90, 199, 252, 5, 250, 197, 62, 248, 222, 140, 25, 62, 119,
2248 197, 244, 63, 124, 235, 141, 43, 11, 163, 215, 207, 127, 105, 209, 51,
2249 32, 156, 17, 223, 120, 249, 19, 77, 35, 108, 248, 130, 158, 240, 94,
2250 152, 185, 127, 109, 243, 45, 253, 78, 201, 108, 250, 104, 255, 81, 80,
2251 80, 62, 198, 34, 143, 17, 212, 118, 132, 218, 242, 80, 173, 212, 198,
2252 166, 71, 168, 73, 164, 95, 229, 67, 62, 242, 145, 143, 252, 122, 241,
2253 107, 174, 253, 106, 175, 125, 107, 175, 253, 107, 183, 62, 181, 90,
2254 129, 79, 170, 244, 214, 200, 254, 168, 106, 15, 242, 145, 255, 209,
2255 230, 127, 44, 90, 207, 40, 40, 40, 15, 74, 112, 254, 31, 156, 255, 71,
2256 56, 127, 112, 106, 195, 89, 74, 136, 246, 78, 188, 239, 44, 165, 196,
2257 243, 7, 171, 204, 255, 99, 203, 211, 47, 215, 196, 202, 228, 8, 149,
2258 117, 137, 202, 188, 188, 197, 13, 155, 238, 252, 63, 225, 205, 239,
2259 222, 144, 35, 136, 216, 32, 225, 13, 189, 249, 127, 28, 130, 121, 83,
2260 224, 8, 65, 1, 91, 56, 55, 175, 218, 252, 63, 193, 171, 254, 178, 240,
2261 8, 66, 182, 191, 28, 52, 48, 255, 143, 248, 8, 42, 108, 141, 249, 127,
2262 96, 174, 31, 249, 17, 88, 182, 161, 239, 255, 176, 71, 184, 226, 151,
2263 178, 197, 95, 15, 210, 152, 255, 7, 160, 200, 23, 207, 8, 164, 58,
2264 255, 15, 203, 150, 205, 31, 235, 47, 73, 142, 160, 58, 255, 79, 112,
2265 93, 206, 174, 28, 97, 93, 52, 255, 142, 34, 95, 204, 150, 220, 63,
2266 225, 17, 84, 230, 255, 145, 232, 207, 122, 98, 93, 162, 63, 58, 243,
2267 255, 132, 55, 191, 92, 19, 43, 37, 216, 111, 253, 144, 35, 108, 30,
2268 51, 124, 195, 162, 51, 255, 143, 237, 34, 157, 247, 134, 156, 155,
2269 251, 82, 208, 197, 196, 90, 229, 249, 185, 105, 51, 48, 255, 143, 237,
2270 66, 234, 134, 179, 152, 16, 205, 232, 147, 88, 115, 22, 83, 55, 108,
2271 38, 230, 255, 209, 133, 206, 252, 63, 134, 231, 239, 173, 149, 143,
2272 243, 255, 214, 60, 255, 207, 244, 234, 174, 215, 159, 58, 242, 228,
2273 225, 106, 96, 177, 248, 206, 239, 122, 253, 192, 244, 247, 95, 254,
2274 238, 232, 119, 71, 159, 54, 141, 233, 213, 174, 215, 222, 56, 63, 48,
2275 247, 63, 95, 133, 89, 132, 225, 24, 230, 208, 245, 218, 129, 105, 96,
2276 67, 254, 171, 185, 134, 167, 142, 124, 255, 101, 96, 127, 241, 112,
2277 117, 120, 242, 48, 228, 226, 201, 42, 217, 148, 255, 189, 19, 181,
2278 240, 159, 102, 207, 255, 153, 42, 65, 249, 95, 124, 224, 252, 203, 67,
2279 213, 129, 227, 175, 31, 170, 14, 247, 134, 255, 153, 195, 111, 29,
2280 170, 14, 247, 138, 255, 210, 161, 234, 64, 249, 235, 85, 178, 239, 13,
2281 255, 105, 194, 247, 84, 9, 202, 127, 235, 129, 242, 159, 58, 242, 210,
2282 161, 239, 84, 137, 223, 12, 190, 231, 208, 19, 85, 2, 248, 79, 30,
2283 246, 28, 250, 234, 193, 234, 80, 43, 31, 234, 144, 183, 72, 62, 190,
2284 112, 176, 58, 204, 143, 127, 135, 112, 63, 125, 48, 115, 160, 58, 252,
2285 247, 213, 185, 3, 199, 247, 185, 247, 125, 123, 95, 75, 85, 176, 88,
2286 38, 19, 127, 178, 239, 77, 79, 159, 167, 163, 183, 26, 128, 253, 254,
2287 163, 149, 175, 5, 30, 247, 24, 27, 255, 47, 106, 11, 144, 125, 141,
2288 88, 200, 174, 215, 14, 175, 170, 197, 14, 244, 45, 60, 88, 229, 127,
2289 25, 122, 232, 156, 50, 95, 223, 194, 3, 255, 165, 67, 115, 7, 254,
2290 171, 98, 30, 140, 216, 248, 47, 18, 253, 106, 217, 247, 189, 128, 18,
2291 223, 136, 141, 93, 39, 218, 121, 201, 243, 184, 167, 122, 254, 167,
2292 15, 6, 60, 202, 49, 82, 35, 252, 183, 52, 248, 70, 108, 236, 91, 135,
2293 50, 7, 30, 36, 255, 37, 13, 190, 17, 27, 15, 252, 62, 21, 190, 17, 27,
2294 93, 43, 223, 67, 180, 79, 141, 111, 196, 70, 223, 79, 190, 17, 27, 91,
2295 43, 255, 59, 135, 142, 239, 187, 95, 124, 35, 54, 182, 86, 254, 19,
2296 53, 242, 191, 122, 240, 248, 190, 94, 149, 30, 18, 35, 54, 246, 171,
2297 7, 221, 53, 241, 191, 112, 15, 248, 29, 42, 124, 35, 54, 94, 139, 111,
2298 196, 70, 127, 250, 224, 183, 107, 226, 103, 14, 168, 243, 141, 216,
2299 248, 185, 3, 127, 178, 15, 190, 213, 162, 196, 215, 183, 240, 115, 7,
2300 90, 88, 237, 177, 42, 218, 15, 125, 11, 255, 169, 159, 244, 109, 190,
2301 235, 39, 23, 125, 11, 191, 149, 181, 213, 255, 45, 161, 196, 182, 72,
2302 251, 15, 101, 246, 93, 250, 174, 191, 146, 196, 138, 254, 130, 51,
2303 235, 96, 170, 1, 176, 211, 165, 116, 201, 149, 115, 102, 171, 1, 176,
2304 97, 86, 19, 103, 182, 152, 110, 204, 20, 211, 70, 193, 237, 235, 202,
2305 193, 217, 29, 140, 111, 177, 109, 190, 26, 56, 24, 87, 206, 193, 116,
2306 39, 27, 226, 213, 161, 49, 227, 96, 82, 203, 109, 243, 181, 241, 155,
2307 18, 213, 242, 161, 36, 194, 169, 218, 249, 185, 88, 117, 128, 123, 16,
2308 78, 53, 196, 171, 229, 167, 150, 107, 231, 251, 22, 107, 225, 167,
2309 150, 129, 159, 156, 169, 14, 225, 20, 240, 115, 177, 90, 248, 221,
2310 201, 234, 249, 190, 197, 112, 234, 94, 240, 67, 225, 234, 0, 252, 182,
2311 249, 228, 76, 181, 252, 238, 36, 60, 185, 15, 150, 223, 148, 8, 133,
2312 189, 147, 213, 161, 109, 30, 222, 128, 122, 112, 252, 166, 4, 212, 61,
2313 181, 242, 149, 223, 32, 49, 130, 166, 4, 212, 61, 213, 243, 27, 226,
2314 80, 247, 84, 207, 135, 103, 56, 20, 174, 150, 13, 231, 135, 255, 173,
2315 99, 246, 32, 253, 51, 10, 110, 223, 198, 140, 61, 104, 13, 88, 3, 140,
2316 191, 58, 192, 251, 59, 137, 97, 207, 64, 167, 183, 165, 191, 26, 128,
2317 253, 46, 166, 237, 65, 126, 141, 49, 255, 159, 219, 87, 223, 194, 131,
2318 165, 117, 102, 213, 218, 14, 218, 214, 29, 248, 197, 116, 119, 50, 57,
2319 147, 90, 86, 230, 235, 91, 122, 176, 78, 201, 25, 123, 176, 49, 163,
2320 196, 215, 183, 240, 160, 159, 161, 48, 227, 111, 29, 83, 226, 27, 177,
2321 145, 160, 159, 65, 31, 45, 235, 234, 248, 93, 33, 207, 128, 114, 251,
2322 211, 8, 63, 57, 211, 58, 86, 43, 191, 211, 171, 204, 55, 98, 35, 63,
2323 234, 252, 80, 216, 30, 84, 227, 27, 177, 145, 148, 175, 236, 127, 124,
2324 20, 248, 222, 73, 117, 190, 17, 27, 249, 224, 249, 214, 192, 253, 226,
2325 27, 177, 145, 93, 161, 143, 47, 223, 136, 141, 108, 29, 99, 252, 106,
2326 207, 143, 81, 62, 107, 151, 30, 16, 223, 30, 76, 12, 131, 31, 172,
2327 196, 215, 179, 242, 96, 221, 19, 195, 80, 122, 246, 160, 18, 95, 219,
2328 186, 39, 134, 19, 195, 65, 31, 148, 157, 205, 163, 236, 131, 235, 91,
2329 120, 176, 231, 54, 15, 55, 215, 143, 76, 52, 188, 127, 238, 8, 246,
2330 160, 186, 255, 15, 222, 115, 186, 68, 103, 119, 244, 23, 16, 136, 251,
2331 3, 170, 97, 84, 219, 168, 198, 65, 204, 169, 152, 6, 255, 27, 129,
2332 184, 31, 0, 191, 5, 52, 143, 211, 56, 87, 142, 248, 34, 243, 61, 167,
2333 243, 99, 237, 17, 192, 219, 65, 154, 46, 4, 182, 77, 1, 48, 197, 180,
2334 182, 180, 61, 210, 28, 105, 139, 67, 84, 26, 180, 14, 234, 56, 162,
2335 113, 137, 221, 209, 29, 83, 249, 224, 142, 8, 0, 83, 76, 239, 121, 58,
2336 213, 62, 181, 37, 90, 76, 83, 43, 235, 204, 146, 58, 46, 186, 35, 178,
2337 59, 178, 229, 228, 238, 200, 110, 76, 49, 189, 47, 233, 142, 72, 251,
2338 84, 83, 28, 122, 240, 98, 197, 98, 186, 39, 190, 99, 106, 119, 100,
2339 40, 218, 60, 62, 20, 5, 96, 138, 233, 189, 79, 137, 214, 77, 109, 153,
2340 42, 166, 193, 178, 166, 150, 161, 254, 3, 157, 219, 54, 49, 29, 5,
2341 180, 99, 138, 233, 61, 78, 89, 157, 139, 92, 31, 75, 45, 131, 23, 139,
2342 58, 135, 233, 253, 79, 81, 231, 48, 173, 119, 138, 58, 135, 105, 189,
2343 83, 212, 57, 76, 235, 157, 162, 206, 97, 90, 239, 20, 117, 14, 211,
2344 122, 167, 168, 115, 152, 214, 59, 69, 157, 195, 180, 222, 169, 84,
2345 231, 218, 37, 58, 135, 41, 166, 247, 58, 21, 234, 28, 244, 125, 53,
2346 71, 177, 239, 11, 211, 122, 244, 125, 229, 39, 161, 239, 11, 250, 248,
2347 219, 18, 237, 83, 216, 199, 143, 233, 253, 238, 227, 223, 54, 209,
2348 116, 154, 246, 241, 195, 88, 166, 45, 81, 162, 117, 56, 150, 9, 211,
2349 251, 151, 78, 109, 155, 200, 135, 97, 44, 19, 63, 102, 179, 41, 222,
2350 48, 117, 224, 197, 235, 99, 128, 255, 85, 73, 119, 13, 230, 131, 0,
2351 76, 49, 173, 45, 189, 62, 150, 15, 53, 157, 230, 198, 108, 226, 216,
2352 116, 68, 61, 32, 30, 155, 142, 239, 224, 32, 238, 63, 196, 239, 224,
2353 160, 182, 33, 234, 5, 170, 119, 180, 53, 23, 78, 33, 16, 247, 31, 180,
2354 69, 7, 241, 185, 71, 122, 31, 35, 248, 22, 139, 103, 9, 70, 89, 204,
2355 18, 172, 18, 148, 89, 60, 210, 7, 120, 140, 224, 91, 4, 207, 178, 24,
2356 37, 152, 101, 177, 74, 80, 102, 241, 136, 251, 17, 247, 99, 4, 223,
2357 98, 241, 44, 193, 40, 139, 89, 130, 85, 22, 101, 130, 71, 158, 3, 60,
2358 70, 240, 45, 22, 207, 18, 140, 178, 152, 37, 88, 37, 40, 111, 226, 46,
2359 193, 29, 130, 219, 44, 74, 4, 27, 44, 62, 36, 184, 197, 162, 72, 112,
2360 147, 224, 3, 22, 239, 19, 20, 88, 220, 32, 184, 206, 34, 79, 144, 99,
2361 241, 30, 193, 53, 22, 87, 9, 178, 4, 255, 206, 226, 93, 130, 43, 44,
2362 24, 130, 127, 99, 113, 153, 96, 157, 69, 134, 224, 215, 4, 151, 88,
2363 172, 241, 216, 75, 240, 83, 22, 63, 35, 120, 129, 197, 97, 130, 35, 4,
2364 163, 44, 78, 176, 120, 153, 224, 85, 130, 215, 88, 188, 78, 48, 205,
2365 226, 20, 193, 44, 193, 28, 139, 179, 4, 231, 88, 44, 16, 156, 103,
2366 177, 68, 176, 194, 98, 149, 32, 195, 130, 33, 200, 178, 200, 17, 20,
2367 8, 138, 44, 74, 4, 101, 138, 51, 44, 142, 17, 208, 27, 216, 65, 176,
2368 157, 197, 86, 2, 11, 193, 218, 93, 192, 25, 130, 99, 44, 122, 9, 58,
2369 88, 108, 39, 216, 202, 194, 66, 176, 118, 103, 237, 206, 25, 22, 199,
2370 8, 122, 89, 116, 16, 108, 103, 177, 149, 192, 194, 98, 237, 246, 218,
2371 237, 51, 4, 199, 88, 244, 18, 116, 176, 216, 78, 176, 149, 5, 124, 87,
2372 132, 142, 77, 15, 167, 80, 231, 80, 231, 234, 165, 115, 225, 20, 216,
2373 88, 227, 58, 247, 24, 234, 28, 234, 28, 234, 28, 234, 28, 234, 28,
2374 234, 28, 234, 28, 234, 28, 234, 28, 234, 28, 234, 28, 234, 28, 234,
2375 28, 234, 28, 234, 28, 234, 28, 234, 28, 234, 28, 234, 28, 234, 28,
2376 234, 28, 234, 28, 234, 28, 234, 28, 234, 28, 234, 28, 234, 28, 234,
2377 28, 234, 28, 234, 28, 234, 28, 234, 28, 234, 28, 234, 28, 234, 28,
2378 234, 220, 125, 210, 57, 51, 99, 54, 81, 231, 80, 231, 106, 213, 57,
2379 250, 78, 53, 142, 77, 71, 212, 11, 252, 23, 34, 240, 29, 28, 68, 125,
2380 32, 125, 247, 11, 53, 15, 113, 255, 128, 223, 251, 66, 212, 27, 248,
2381 189, 47, 76, 235, 155, 226, 247, 190, 48, 125, 0, 41, 126, 239, 11,
2382 211, 186, 167, 248, 189, 47, 76, 31, 196, 156, 135, 248, 189, 47, 76,
2383 235, 151, 226, 28, 214, 152, 214, 59, 69, 157, 195, 180, 222, 41, 234,
2384 28, 166, 245, 78, 81, 231, 48, 173, 119, 138, 58, 135, 105, 189, 83,
2385 212, 57, 76, 235, 157, 162, 206, 97, 90, 239, 20, 117, 14, 211, 122,
2386 167, 248, 189, 47, 76, 235, 157, 226, 247, 190, 48, 173, 127, 138,
2387 223, 251, 194, 180, 254, 125, 252, 248, 189, 47, 76, 235, 59, 150, 9,
2388 191, 247, 133, 41, 126, 239, 11, 241, 241, 6, 126, 239, 11, 81, 111,
2389 224, 247, 190, 16, 15, 6, 248, 189, 47, 68, 189, 129, 223, 251, 194,
2390 185, 35, 30, 204, 220, 17, 248, 189, 47, 212, 57, 156, 151, 9, 117,
2391 14, 117, 14, 117, 14, 117, 14, 117, 14, 117, 14, 117, 14, 117, 14,
2392 117, 14, 117, 14, 117, 14, 117, 14, 117, 14, 117, 14, 117, 14, 117,
2393 14, 117, 14, 117, 14, 117, 14, 117, 14, 117, 14, 117, 14, 117, 14,
2394 117, 14, 117, 14, 117, 14, 117, 14, 117, 14, 117, 14, 117, 14, 117,
2395 14, 117, 14, 117, 14, 117, 14, 117, 238, 147, 168, 115, 248, 189, 47,
2396 212, 185, 122, 234, 28, 126, 239, 11, 81, 95, 224, 247, 190, 16, 245,
2397 6, 125, 7, 231, 255, 3, 87, 66, 189, 33
2398 };
2399 #define LOAD_ASSETS() GD.copy(__assets, sizeof(__assets))
2400 #define ICONS32_HANDLE 0
2401 #define ICONS32_WIDTH 32
2402 #define ICONS32_HEIGHT 32
2403 #define ICONS32_CELLS 35
2404 #define SLIDER_HANDLE 1
2405 #define SLIDER_WIDTH 314
2406 #define SLIDER_HEIGHT 22
2407 #define SLIDER_CELLS 2
2408 #define NUMBERS_HANDLE 2
2409 #define NUMBERS_WIDTH 314
2410 #define NUMBERS_HEIGHT 22
2411 #define NUMBERS_CELLS 2
2412 #define ASSETS_END 126944UL
2413 static const shape_t ICONS32_SHAPE = {0, 32, 32, 0};
2414 static const shape_t SLIDER_SHAPE = {1, 314, 22, 0};
2415 static const shape_t NUMBERS_SHAPE = {2, 314, 22, 0};
2416 
2417 #endif
2418 
void stream(void)
Definition: gd2_ext.h:751
void restart()
Definition: gd2_ext.h:444
void bulkrd(uint32_t a)
Definition: gd2_ext.h:1690
#define REG_CMD_WRITE
Definition: gd2_ext.h:367
struct GDClass::@0 inputs
static uint8_t spiReceive(uint8_t send=0xff)
Definition: HAL.h:655
void cmd_number(int16_t x, int16_t y, byte font, uint16_t options, uint32_t n)
Definition: gd2_ext.h:1494
uint16_t wp
Definition: gd2_ext.h:802
void cmd_toggle(int16_t x, int16_t y, int16_t w, byte font, uint16_t options, uint16_t state, const char *s)
Definition: gd2_ext.h:1602
void cmd_inflate(uint32_t ptr)
Definition: gd2_ext.h:1442
int16_t tag_y
Definition: gd2_ext.h:81
#define REG_PLAYBACK_LENGTH
Definition: gd2_ext.h:393
void BitmapSource(uint32_t addr)
Definition: gd2_ext.h:1165
static unsigned int __rd16(uint32_t addr)
Definition: gd2_ext.h:757
void wr16(uint32_t addr, uint32_t v)
Definition: gd2_ext.h:650
void cmd_progress(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t range)
Definition: gd2_ext.h:1504
#define GD_STORAGE
Definition: gd2_ext.h:42
void PointSize(uint16_t size)
Definition: gd2_ext.h:1280
void SaveContext(void)
Definition: gd2_ext.h:1292
#define REG_SWIZZLE
Definition: gd2_ext.h:402
uint32_t getwp(void)
Definition: gd2_ext.h:705
void resume(void)
Definition: gd2_ext.h:715
void BitmapTransformE(int32_t e)
Definition: gd2_ext.h:1185
static void __start(uint32_t addr)
Definition: gd2_ext.h:721
void ClearColorRGB(byte red, byte green, byte blue)
Definition: gd2_ext.h:1209
uint16_t __dummy_1
Definition: gd2_ext.h:78
void cmd_fgcolor(uint32_t c)
Definition: gd2_ext.h:1408
void ColorMask(byte r, byte g, byte b, byte a)
Definition: gd2_ext.h:1238
#define LINE_STRIP
Definition: gd2_ext.h:294
void tune(void)
Definition: gd2_ext.h:834
void wr(uint32_t addr, uint8_t v)
Definition: gd2_ext.h:1621
byte rd(uint32_t addr)
Definition: gd2_ext.h:620
void cmd_spinner(int16_t x, int16_t y, byte style, byte scale)
Definition: gd2_ext.h:1557
#define REG_PCLK
Definition: gd2_ext.h:388
static void cFFFFFF(byte v)
Definition: gd2_ext.h:1077
void dumpscreen(void)
void cmd_regwrite(uint32_t ptr, uint32_t val)
Definition: gd2_ext.h:1487
void BitmapTransformA(int32_t a)
Definition: gd2_ext.h:1169
void wr_n(uint32_t addr, byte *src, uint32_t n)
Definition: gd2_ext.h:1641
#define KEEP
Definition: gd2_ext.h:260
void cmd_snapshot(uint32_t ptr)
Definition: gd2_ext.h:1553
uint16_t lcg
Definition: gd2_ext.h:217
void outline()
Definition: gd2_ext.h:502
static void cH(uint16_t)
Definition: gd2_ext.h:1061
void getfree(uint16_t n)
Definition: gd2_ext.h:787
void cmd_interrupt(uint32_t ms)
Definition: gd2_ext.h:1447
void swap(void)
Definition: gd2_ext.h:814
#define INVERT
Definition: gd2_ext.h:264
static void cs(const char *)
Definition: gd2_ext.h:1096
void stop()
Definition: gd2_ext.h:743
uint16_t rz
Definition: gd2_ext.h:77
void cmd_setfont(byte font, uint32_t ptr)
Definition: gd2_ext.h:1531
void flush()
Definition: gd2_ext.h:595
static void delayMilliseconds(unsigned int delayMs)
Definition: HAL.h:518
void cmd_keys(int16_t x, int16_t y, int16_t w, int16_t h, byte font, uint16_t options, const char *s)
Definition: gd2_ext.h:1451
uint32_t measure_freq(void)
Definition: gd2_ext.h:823
void Display(void)
Definition: gd2_ext.h:1260
void cmd_getprops(uint32_t &ptr, uint32_t &w, uint32_t &h)
Definition: gd2_ext.h:1420
#define WRITE(IO, v)
Write to a pin wrapper.
Definition: fastio.h:48
Definition: gd2_ext.h:222
static void spiSend(uint8_t b)
Definition: HAL.h:674
void BitmapHandle(byte handle)
Definition: gd2_ext.h:1132
void cmd_button(int16_t x, int16_t y, uint16_t w, uint16_t h, byte font, uint16_t options, const char *s)
Definition: gd2_ext.h:1383
#define REG_GPIO
Definition: gd2_ext.h:374
uint16_t random()
Definition: gd2_ext.h:951
#define REG_CLOCK
Definition: gd2_ext.h:364
void BlendFunc(byte src, byte dst)
Definition: gd2_ext.h:1193
byte streaming
Definition: gd2_ext.h:801
Definition: gd2_ext.h:46
void cmd_scrollbar(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t options, uint16_t val, uint16_t size, uint16_t range)
Definition: gd2_ext.h:1527
void BitmapLayout(byte format, uint16_t linestride, uint16_t height)
Definition: gd2_ext.h:1136
byte handle
Definition: gd2_ext.h:224
void cmd32(uint32_t b)
Definition: gd2_ext.h:1650
void cmd_scale(int32_t sx, int32_t sy)
Definition: gd2_ext.h:1517
void cmd_gauge(int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t major, uint16_t minor, uint16_t val, uint16_t range)
Definition: gd2_ext.h:1412
int16_t x
Definition: gd2_ext.h:80
void cmd_clock(int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t h, uint16_t m, uint16_t s, uint16_t ms)
Definition: gd2_ext.h:1392
void resume(void)
Definition: gd2_ext.h:1694
void cmd_bgcolor(uint32_t c)
Definition: gd2_ext.h:1379
static char readFlashByte(PGM_P ptr)
Definition: HAL.h:584
void cmd_screensaver(void)
Definition: gd2_ext.h:1523
void wr32(uint32_t addr, uint32_t v)
Definition: gd2_ext.h:1637
#define REG_PLAY
Definition: gd2_ext.h:390
#define REG_TRACKER
Definition: gd2_ext.h:425
void cmd_calibrate(void)
Definition: gd2_ext.h:1387
void wr16(uint32_t addr, uint16_t v)
Definition: gd2_ext.h:1629
void finish(void)
Definition: gd2_ext.h:1654
void cmdbyte(byte x)
Definition: gd2_ext.h:561
void cmdbyte(uint8_t b)
Definition: gd2_ext.h:1646
void draw()
Definition: gd2_ext.h:497
#define SET_OUTPUT(IO)
set pin as output wrapper
Definition: fastio.h:56
void cmd_memwrite(uint32_t ptr, uint32_t num)
Definition: gd2_ext.h:1483
static const PROGMEM prog_uchar __assets[9797]
Definition: gd2_ext.h:1743
static GDTransport GDTR
Definition: gd2_ext.h:806
static uint8_t eprGetByte(unsigned int pos)
Definition: HAL.h:546
void get_inputs(void)
Definition: gd2_ext.h:1674
void play(uint8_t instrument, uint8_t note=0)
Definition: gd2_ext.h:1702
static void hostcmd(byte a)
Definition: gd2_ext.h:777
void StencilMask(byte mask)
Definition: gd2_ext.h:1308
#define REG_TAG
Definition: gd2_ext.h:403
void v(int _x, int _y)
Definition: gd2_ext.h:467
void finish()
Definition: gd2_ext.h:488
void cmd_slider(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t options, uint16_t val, uint16_t range)
Definition: gd2_ext.h:1549
void TagMask(byte mask)
Definition: gd2_ext.h:1316
static const shape_t SLIDER_SHAPE
Definition: gd2_ext.h:2414
void cmd_translate(int32_t tx, int32_t ty)
Definition: gd2_ext.h:1610
void cmd_sketch(int16_t x, int16_t y, uint16_t w, uint16_t h, uint32_t ptr, uint16_t format)
Definition: gd2_ext.h:1539
static void ch(int16_t)
Definition: gd2_ext.h:1067
void cmd_textP(int16_t x, int16_t y, byte font, uint16_t options, PGM_P s)
Definition: gd2_ext.h:1584
static const shape_t NUMBERS_SHAPE
Definition: gd2_ext.h:2415
static void spiInit(uint8_t spiRate)
Definition: HAL.h:635
GDClass GD
Definition: gd2_ext.h:808
void storage(void)
uint32_t rd32(uint32_t addr)
Definition: gd2_ext.h:659
void begin(uint8_t options=(GD_CALIBRATE|GD_TRIM|GD_STORAGE))
Definition: gd2_ext.h:842
void cmd_n(byte *s, uint16_t n)
Definition: gd2_ext.h:571
void Vertex2ii(uint16_t x, uint16_t y, byte handle=0, byte cell=0)
Definition: gd2_ext.h:1330
void cmd_getmatrix(void)
Definition: gd2_ext.h:1416
#define EDGE_STRIP_B
Definition: gd2_ext.h:298
byte load(const char *filename, void(*progress)(long, long)=NULL)
#define GD_TRIM
Definition: gd2_ext.h:41
void __end(void)
Definition: gd2_ext.h:1698
uint8_t tag
Definition: gd2_ext.h:83
void StencilFunc(byte func, byte ref, byte mask)
Definition: gd2_ext.h:1304
#define EPR_TOUCHSCREEN
Definition: Eeprom.h:108
void cmd_loadidentity(void)
Definition: gd2_ext.h:1455
void ClearStencil(byte s)
Definition: gd2_ext.h:1226
void Macro(byte m)
Definition: gd2_ext.h:1276
void cmd_loadimage(uint32_t ptr, int32_t options)
Definition: gd2_ext.h:1459
void Cell(byte cell)
Definition: gd2_ext.h:1201
uint16_t rd16(uint32_t addr)
Definition: gd2_ext.h:638
uint16_t lfsr
Definition: gd2_ext.h:217
void copyram(byte *src, int count)
Definition: gd2_ext.h:1117
void bulk(uint32_t addr)
Definition: gd2_ext.h:710
void wr_n(uint32_t addr, byte *src, uint16_t n)
Definition: gd2_ext.h:685
uint8_t ptag
Definition: gd2_ext.h:84
#define REG_PCLK_POL
Definition: gd2_ext.h:389
uint16_t atan2(int16_t y, int16_t x)
Definition: gd2_ext.h:1000
void self_calibrate(void)
Definition: gd2_ext.h:934
void BitmapTransformF(int32_t f)
Definition: gd2_ext.h:1189
#define EQUAL
Definition: gd2_ext.h:237
#define REG_TOUCH_RZTHRESH
Definition: gd2_ext.h:414
#define RAM_CMD
Definition: gd2_ext.h:360
static void __wstart(uint32_t addr)
Definition: gd2_ext.h:729
byte n
Definition: gd2_ext.h:443
uint16_t size
Definition: gd2_ext.h:226
void End(void)
Definition: gd2_ext.h:1264
void reset(void)
Definition: gd2_ext.h:1716
#define EPR_INTEGRITY_BYTE
Definition: Eeprom.h:56
void sample(uint32_t start, uint32_t len, uint16_t freq, uint16_t format, int loop=0)
Definition: gd2_ext.h:1707
void cmd_setmatrix(void)
Definition: gd2_ext.h:1535
static void eprSetByte(unsigned int pos, uint8_t value)
Definition: HAL.h:530
void ColorRGB(byte red, byte green, byte blue)
Definition: gd2_ext.h:1242
void begin()
Definition: gd2_ext.h:526
void Call(uint16_t dest)
Definition: gd2_ext.h:1197
void cmd_swap(void)
Definition: gd2_ext.h:1569
#define REG_TRIM
Definition: gd2_ext.h:831
static const PROGMEM prog_uchar __bsod[31]
Definition: gd2_ext.h:1725
void Jump(uint16_t dest)
Definition: gd2_ext.h:1268
int16_t tag_x
Definition: gd2_ext.h:82
void cmd_gradient(int16_t x0, int16_t y0, uint32_t rgb0, int16_t x1, int16_t y1, uint32_t rgb1)
Definition: gd2_ext.h:1438
void cmd_dial(int16_t x, int16_t y, int16_t r, uint16_t options, uint16_t val)
Definition: gd2_ext.h:1400
void cmd32(uint32_t x)
Definition: gd2_ext.h:542
static void __wr16(uint32_t addr, unsigned int v)
Definition: gd2_ext.h:769
static void align(byte n)
Definition: gd2_ext.h:1055
void cmd_regread(uint32_t ptr)
Definition: gd2_ext.h:1508
#define REG_CMD_READ
Definition: gd2_ext.h:366
void cmd_memcpy(uint32_t dest, uint32_t src, uint32_t num)
Definition: gd2_ext.h:1463
#define REG_PLAYBACK_FORMAT
Definition: gd2_ext.h:391
uint16_t track_val
Definition: gd2_ext.h:76
static float min(float a, float b)
Definition: Repetier.h:632
byte rd(uint32_t addr)
Definition: gd2_ext.h:1617
void perim()
Definition: gd2_ext.h:452
static const PROGMEM prog_uchar atan8[]
Definition: gd2_ext.h:995
const int8_t sensitive_pins [] PROGMEM
Definition: Commands.cpp:24
#define REG_PLAYBACK_FREQ
Definition: gd2_ext.h:392
void Clear(void)
Definition: gd2_ext.h:1222
void RestoreContext(void)
Definition: gd2_ext.h:1284
static const shape_t ICONS32_SHAPE
Definition: gd2_ext.h:2413
void wr(uint32_t addr, byte v)
Definition: gd2_ext.h:630
void rd_n(byte *dst, uint32_t addr, uint16_t n)
Definition: gd2_ext.h:676
void cmd_append(uint32_t ptr, uint32_t num)
Definition: gd2_ext.h:1373
uint16_t rp()
Definition: gd2_ext.h:599
#define UI_DISPLAY_CS
Definition: DisplayList.h:1022
void polar(int &x, int &y, int16_t r, uint16_t th)
Definition: gd2_ext.h:988
void ColorA(byte alpha)
Definition: gd2_ext.h:1234
#define REG_GPIO_DIR
Definition: gd2_ext.h:375
int16_t rsin(int16_t r, uint16_t th)
Definition: gd2_ext.h:969
void Tag(byte s)
Definition: gd2_ext.h:1320
void cmd_text(int16_t x, int16_t y, byte font, uint16_t options, const char *s)
Definition: gd2_ext.h:1573
void safeload(const char *filename)
void ScissorXY(uint16_t x, uint16_t y)
Definition: gd2_ext.h:1300
void seed(uint16_t n)
Definition: gd2_ext.h:946
void BitmapTransformD(int32_t d)
Definition: gd2_ext.h:1181
#define GD_CALIBRATE
Definition: gd2_ext.h:40
static void printErrorFLN(FSTRINGPARAM(text))
Definition: Communication.cpp:522
void LineWidth(uint16_t width)
Definition: gd2_ext.h:1272
static void delayMicroseconds(unsigned int delayUs)
Definition: HAL.h:514
void Return(void)
Definition: gd2_ext.h:1288
void paint()
Definition: gd2_ext.h:477
void Vertex2f(int16_t x, int16_t y)
Definition: gd2_ext.h:1324
void flush(void)
Definition: gd2_ext.h:809
#define LOW_FREQ_BOUND
Definition: gd2_ext.h:832
void StencilOp(byte sfail, byte spass)
Definition: gd2_ext.h:1312
#define REG_FREQUENCY
Definition: gd2_ext.h:373
static const PROGMEM prog_uchar __bsod_badfile[31]
Definition: gd2_ext.h:1731
void AlphaFunc(byte func, byte ref)
Definition: gd2_ext.h:1124
int y1
Definition: gd2_ext.h:441
#define REG_PLAYBACK_START
Definition: gd2_ext.h:397
static void fmtcmd(const char *fmt,...)
Definition: gd2_ext.h:1345
void cmd_coldstart(void)
Definition: gd2_ext.h:1396
uint16_t track_tag
Definition: gd2_ext.h:75
static void cI(uint32_t)
Definition: gd2_ext.h:1072
static void ci(int32_t)
Definition: gd2_ext.h:1091
void cmd_dlstart(void)
Definition: gd2_ext.h:1404
void wr32(uint32_t addr, unsigned long v)
Definition: gd2_ext.h:694
void BitmapTransformC(int32_t c)
Definition: gd2_ext.h:1177
void cmd_track(int16_t x, int16_t y, uint16_t w, uint16_t h, byte tag)
Definition: gd2_ext.h:1606
static const PROGMEM prog_int16_t sintab[257]
Definition: gd2_ext.h:964
int16_t y
Definition: gd2_ext.h:79
void copy(const PROGMEM prog_uchar *src, int count)
Definition: gd2_ext.h:1106
uint16_t freespace
Definition: gd2_ext.h:803
Definition: gd2_ext.h:439
int16_t rcos(int16_t r, uint16_t th)
Definition: gd2_ext.h:983
#define REG_CPURESET
Definition: gd2_ext.h:368
#define ALWAYS
Definition: gd2_ext.h:239
void cmd_gradcolor(uint32_t c)
Definition: gd2_ext.h:1434
#define REG_TOUCH_RZ
Definition: gd2_ext.h:413
uint16_t w
Definition: gd2_ext.h:225
void begin()
Definition: gd2_ext.h:459
Definition: gd2_ext.h:523
void BitmapTransformB(int32_t b)
Definition: gd2_ext.h:1173
void BitmapSize(byte filter, byte wrapx, byte wrapy, uint16_t width, uint16_t height)
Definition: gd2_ext.h:1150
void cmd_memset(uint32_t ptr, byte value, uint32_t num)
Definition: gd2_ext.h:1467
void ClearTag(byte s)
Definition: gd2_ext.h:1230
#define REG_ROTATE
Definition: gd2_ext.h:400
#define OPT_CENTERX
Definition: gd2_ext.h:304
void cmd_rotate(int32_t a)
Definition: gd2_ext.h:1512
void cmd_getptr(void)
Definition: gd2_ext.h:1430
void finish()
Definition: gd2_ext.h:610
#define REG_TOUCH_TRANSFORM_A
Definition: gd2_ext.h:419
#define REG_PLAYBACK_LOOP
Definition: gd2_ext.h:394
uint32_t cmd_memcrc(uint32_t ptr, uint32_t num)
Definition: gd2_ext.h:1474
void get_accel(int &x, int &y, int &z)
Definition: gd2_ext.h:1658
void ScissorSize(uint16_t width, uint16_t height)
Definition: gd2_ext.h:1296
uint32_t rd32(uint32_t addr)
Definition: gd2_ext.h:1633
void Begin(byte prim)
Definition: gd2_ext.h:1128
#define REG_SOUND
Definition: gd2_ext.h:401
#define REG_PLAYBACK_PLAY
Definition: gd2_ext.h:395
void cmd_stop(void)
Definition: gd2_ext.h:1565
#define REG_ID
Definition: gd2_ext.h:381
void ClearColorA(byte alpha)
Definition: gd2_ext.h:1205
uint16_t rd16(uint32_t addr)
Definition: gd2_ext.h:1625
static byte sinus(byte x)
Definition: gd2_ext.h:509
static float max(float a, float b)
Definition: Repetier.h:637
static void __end()
Definition: gd2_ext.h:737